Replace two or more spaces within a text file with a ; Replace two or more spaces within a text file with a ; unix unix

Replace two or more spaces within a text file with a ;


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


$ gawk 'BEGIN{FS="  +"}{$1=$1}1' OFS=";" filehello;worldfoo;bara;word with a space$ awk '{gsub(/  +/,";")}1' filehello;worldfoo;bara;word with a space


Try:

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