Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re: How do I remove blank lines from text files?

by davorg (Chancellor)
on Jul 10, 2000 at 21:43 UTC ( #21832=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    while (<>) {
      print if /\S/;
    }
    
  2. or download this
    perl -i.bak -n -e "print if /\S/" filename
    

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://21832]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (6)
As of 2020-10-20 20:55 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My favourite web site is:












    Results (210 votes). Check out past polls.

    Notices?