Script to remove blank lines from a text file
grep -v “^$” filename > newfilename
The ^$ within the quotes is a regular expression: ^=beginning of line, $=end of line, with no characters between.
Note: Running this RegEx to clear blank lines from inside applications doesn’t seem to work.
Tested on OpenOffice, TextPad, MS Office. Have to run this one cmd line for some reason.
btw, TextPad’s RegEx Search has a lot of bugs and/or just missing functionality.