【发布时间】:2012-05-30 13:10:25
【问题描述】:
我一直在使用 sep 来尝试这个,基本上我有一个文本文件,其中包含合理数量的同一行,例如
4444 username "some information" "someotherinformation" "even more information"
我需要用下划线替换引号内的空格,使其看起来像这样
4444 username "some_information" "someotherinformation" "even_more_information"
目前我已经能够分离出引用的信息
sed 's/"\([^"]*\)"/_/g' myfile.txt
关于如何进行的建议?
【问题讨论】:
-
字段之间的空白有多重要?