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

Depends what exactly you mean by a 'blank line'. Assuming that you mean a line that contains only white space characters then you can do something like this:

while (<>) { print if /\S/; }

And you can do the same thing from the command line

perl -i.bak -n -e "print if /\S/" filename
--
<http://www.dave.org.uk>

European Perl Conference - Sept 22/24 2000, ICA, London
<http://www.yapc.org/Europe/>

Replies are listed 'Best First'.
Re^2: How do I remove blank lines from text files?
by 92sai (Novice) on Jun 18, 2015 at 09:09 UTC
    how to remove blank lines in an xml file after modifying it??