Deleting empty lines from text files (sed)
By jeltsch on Tue, 08/09/2005 - 00:00The following sed command deletes empty lines (and those with white spaces only) from text files: sed -e '/^ *$/d' infile.txt > outfile.txt
You have to be careful though: if you copied the textfile from a Macintosh this script won't work. You first have to convert the Macintosh textfile into a UNIX textfile!