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
|
---|
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 | |
by Anonymous Monk on Jun 18, 2015 at 09:25 UTC |