分别用sed awk perl grep 实现:

1 sed '/^$/d' input.txt > output.txt    #output file: output.txt
2 sed -i '/^$/d' input.txt      #output file: input.txt
3 awk 'NF > 0' input.txt > output.txt     #output file: output.txt
4 perl -i.backup -n -e "print if /\S/" input.txt   #output file: input.txt.backup
5 grep -v '^$' input.txt > output.txt    #output file: output.txt

 

工具:

Notepad++ v5.8.7,TextFX, 删除空行。

 

步骤如下:

1 Notepad++ 打开文件

2 选中要处理的文本

3 TextFX --  Edit  --  Delete Surplus Blank Lines

linux/shell 文本文件删除/删掉空行(Notepad++ v5.8.7,TextFX, 删除空行)

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-06-27
  • 2021-07-27
  • 2022-12-23
  • 2021-07-17
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-07-31
  • 2022-12-23
  • 2021-07-27
  • 2022-01-19
  • 2022-01-04
相关资源
相似解决方案