AWK - Delete all blank lines from a file

awk NF file.txt

awk '/./' file.txt

Example

Assuming a file, file.txt, exists with the following contents:

file.txt
aaaaa
bbbbb
 
ccccc
 
 
 
ddddd
 
eeeee

returns:

aaaaa
bbbbb
ccccc
ddddd
eeeee