利用sed或者awk如何处理这段数据,谢谢指点
大师,有这样一段文本,set后面没有逗号,where后面没有and,不能直接在mysql中执行:
UPDATE `sdypt`.`test1`
SET
id=13
name='jree'
birth='1991:10:26'
WHERE
id=13
name='jree'
birth='2011:11:11';
UPDATE `sdypt`.`test1`
SET
id=12
name='tomkyte'
birth='1989:12:25'
WHERE
id=12
name='tomkyte'
birth='2011:11:11';
UPDATE `sdypt`.`test1`
SET
id=11
name='lucy'
birth='1988:08:10'
WHERE
id=11
name='lucy'
birth='2011:11:11';
UPDATE `sdypt`.`test1`
SET
id=10
name='liup'
birth='1987:07:09'
WHERE
id=10
name='liup'
birth='2011:11:11';
请问如何变成这样格式(在set后面字段加逗号,where后面字段加and 可以在mysql中直接执行):
UPDATE `sdypt`.`test1`
SET
id=13 ,
name='jree' ,
birth='1991:10:26'
WHERE
id=13
and name='jree'
and birth='2011:11:11';
UPDATE `sdypt`.`test1`
SET
id=12 ,
name='tomkyte' ,
birth='1989:12:25'
WHERE
id=12
and name='tomkyte'
and birth='2011:11:11';
UPDATE `sdypt`.`test1`
SET
id=11 ,
name= ,
birth='1988:08:10'
WHERE
id=11
and name='lucy'
and birth='2011:11:11';
UPDATE `sdypt`.`test1`
SET
id=10 ,
name='liup' ,
birth='1987:07:09'
WHERE
id=10
and name='liup'
and birth='2011:11:11';