Beefy Boxes and Bandwidth Generously Provided by pair Networks Frank
laziness, impatience, and hubris
 
PerlMonks  

(Ovid) Re: One-liner removes whitespace-only lines from text file

by Ovid (Cardinal)
on Dec 19, 2001 at 02:32 UTC ( #132959=note: print w/ replies, xml ) Need Help??


in reply to (code) One-liner removes whitespace-only lines from text file

perl -i.bak -ne 'print if /\S/' file.txt

Seems a bit more intuitive to me :)

Cheers,
Ovid

Join the Perlmonks Setiathome Group or just click on the the link and check out our stats.


Comment on (Ovid) Re: One-liner removes whitespace-only lines from text file
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (7)
As of 2014-04-19 10:22 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    April first is:







    Results (480 votes), past polls