Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
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.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://132959]
help
Chatterbox?
Discipulus second time; no questions.. o tempora o mores..
[1nickt]: I understood the first version ;-)

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (7)
As of 2017-11-24 22:28 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    In order to be able to say "I know Perl", you must have:













    Results (354 votes). Check out past polls.

    Notices?