2009-10-24 82 views

回答

7
sed -e 's/ \+/;/g' File1 > File2 
+0

甜!为我节省了时间。 – user191960 2009-10-24 01:04:23

-2

尝试:

sed -e 's/ */;/g' file 
+0

一个长度以及DX的删除空格。 – user191960 2009-10-24 00:58:53

0
$ gawk 'BEGIN{FS=" +"}{$1=$1}1' OFS=";" file 
hello;world 
foo;bar 
a;word with a space 

$ awk '{gsub(/ +/,";")}1' file 
hello;world 
foo;bar 
a;word with a space 
相关问题