How can I remove blank lines from a file in UNIX?
grep -v "^$" filename > newfilename
The ^$ within the quotes is a regular expression: ^=beginning of line, $=end of line, with no characters between.
See additional helpful information in the comments below.