in reply to delete empty lines from a txt file

You'll be wanting to use that lovely inplace edit switch -i
perl -i -ne 'print unless /^\s+$/' your_file.txt
For more info on that ever-handy switch checkout perlrun.
HTH

broquaint

Replies are listed 'Best First'.
Re: Re: delete empty lines from a txt file
by davorg (Chancellor) on Nov 14, 2001 at 14:26 UTC

    Notice that broquaint also sneaked in the -n flag there. That's the one that actually sets up a loop that processes the file a line at a time.

    And just to be obtuse, I'd write it like this:

    perl -i.bak -ne 'print if /\S/' your_file.txt
    --
    <http://www.dave.org.uk>

    "The first rule of Perl club is you don't talk about Perl club."