用;替换文本文件中的两个或多个空格;

use*_*960 3 unix awk sed

文件1:

hello      world
foo   bar
a  word with a space
Run Code Online (Sandbox Code Playgroud)

我需要用分号(;)替换长度为两个或更多的所有空格.

结果:

文件2:

hello;world
foo;bar
a;word with a space
Run Code Online (Sandbox Code Playgroud)

Rob*_*ble 8

sed -e 's/  \+/;/g' File1 > File2
Run Code Online (Sandbox Code Playgroud)