This note is for a few quick ways to delete all blank lines from a text file.
- sed ‘/^$/d’ file > file_new
- grep -v "^$" file > file_new
- (This is for Notepad++ users) Select all text (shortcut Ctrl+A) and then click Menu TextFX -> TextFX Edit -> Delete Blank Lines