Article Image
read

去掉空白行

tr -s ["\012"] < test.txt > newtest.txt

sed -n '/./p' temp_file5 > newtest.txt

grep . temp_file5 > newtest.txt

grep -v '^$' temp_file5 > newtest.txt

去掉多余空格

cat test.txt | tr -s [:space:]

sed 's/__*/_/g' test.txt     //这里,_表示一个空格
Blog Logo

Li Longyu


Published

Image

龙宇

知鱼 - 子非鱼 安知鱼之乐

Back to Overview