[CS-FSLUG] An easy way to remove blank lines?

Josiah Ritchie jritchie at bible.edu
Mon Sep 12 06:35:12 CDT 2005


On Sat, 2005-09-10 at 10:47 +0300, Jukka wrote:
> Thank you for these tips!
> So far I was not very succesfull (probably because my lack of
> experience with command-line tools). I have attached an example html
> file.

This takes into account the possibility that there is 0 or more
whitespace characters between the start and end of the line.

sed '/^\s*$/d' < index.html > index.html

It worked for me. WARNING! It will overwrite your file. backup before
you issue this command. Take off the > index.html to have it only output
the changes to the screen and not the file.

JSR/





More information about the Christiansource mailing list