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

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

by jmcnamara (Monsignor)
on Dec 19, 2001 at 14:00 UTC ( #133075=note: print w/replies, xml ) Need Help??


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


This is attributable to abigail:      perl -lp00ee file

Update: As chip points out, this one-liner removes blank lines and not whitespace-only lines.

--
John.

Replies are listed 'Best First'.
Re: Re: One-liner removes whitespace-only lines from text file
by chip (Curate) on Dec 19, 2001 at 14:39 UTC
    Well, 10 out of 10 for cleverness, but abigail's trick only removes empty lines, i.e. those that match /^$/; but the original requirement was to remove lines made up of any combination of whitespace.

        -- Chip Salzenberg, Free-Floating Agent of Chaos

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://133075]
help
Chatterbox?
[SwaJime]: any thoughts?
[Tanktalus]: SwaJime: wouldn't status & status < 13 be true if status was 0?
[SwaJime]: I thought 0 was false, and false AND anything would be false ...
[SwaJime]: unless & is higher precedence than <

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (10)
As of 2017-08-22 18:04 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Who is your favorite scientist and why?



























    Results (338 votes). Check out past polls.

    Notices?