File1:
hello      world
foo   bar
a  word with开发者_如何学C a space
I need to replace all white spaces which are two or more in length with a semi-colon(;).
Result:
File2:
hello;world
foo;bar
a;word with a space
sed -e 's/  \+/;/g' File1 > File2
$ 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
Try:
sed -e 's/  */;/g' file
 
         
                                         
                                         
                                         
                                        ![Interactive visualization of a graph in python [closed]](https://www.devze.com/res/2023/04-10/09/92d32fe8c0d22fb96bd6f6e8b7d1f457.gif) 
                                         
                                         
                                         
                                         加载中,请稍侯......
 加载中,请稍侯......
      
精彩评论