Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
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?
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (7)
As of 2017-06-22 18:45 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    How many monitors do you use while coding?















    Results (526 votes). Check out past polls.