Remove empty lines from a file By T4L | November 26, 2008 1 Comment You can use awk to strip a file of empty line. Do it with awk ‘NF>0’ < text_file
pymonks February 7, 2012 Another longer alternative to create a new file minus the empty lines $ grep -v ^$ filename > filename.new Reply ↓
Another longer alternative to create a new file minus the empty lines
$ grep -v ^$ filename > filename.new