2009-10-24 80 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 
相關問題