1.aaa.txt里面含有几万条的类似信息,需要清理前后的"和"然后把把""变成"
[root@tim home]# cat aaa.txt
"rsrccred create mailGSO rsrcuser yanglei68 rsrcpwd ""Hr666666"" rsrctype web user yanglei6"
"rsrccred create mailGSO rsrcuser zhanggm26 rsrcpwd ""ha_666"" rsrctype web user 0090562"
2.第一想到 sed命令,执行下列命令,得到想要的结果
-
[root@tim home]# cat aaa.txt | sed 's/\""/"/g' | sed 's/^"*//g' | sed 's/.$//g' >> bbb.crv
3.测试是否成功
[root@tim home]# cat bbb.crv
rsrccred create mailGSO rsrcuser yanglei68 rsrcpwd "Hr666666" rsrctype web user yanglei6
rsrccred create mailGSO rsrcuser zhanggm26 rsrcpwd "ha_666" rsrctype web user 0090562
阅读(1032) | 评论(0) | 转发(0) |