Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
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 contemplating the Monastery: (9)
As of 2015-07-06 08:01 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (70 votes), past polls