in reply to How do I remove blank lines from text files?

I realize that I might be chastised for this, but
I feel the need to mention that this is a trivial
task for vi.

Type : and then issue this command

%g/^$/d
The percent sign tells vi 'do this for all lines in the
file.' The g operator means 'globally', and the
d operator means 'perform deletion on the lines
that match'.

Replies are listed 'Best First'.
RE: Re: How do I remove blank lines from text files?
by httptech (Chaplain) on Jul 11, 2000 at 06:48 UTC
    Of course, if you're going to bother to start up vi, you might as well just do perl -pi -e 's/^\n$//' file.txt But I think this exceeds the scope of the original poster's question, since his program is already parsing the file.
RE: Re: How do I remove blank lines from text files?
by le (Friar) on Jul 11, 2000 at 01:46 UTC
    You got a ++ from me -- vi rules! :)