Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re^2: Removing double carriage return

by GrandFather (Sage)
on Aug 20, 2011 at 02:54 UTC ( #921360=note: print w/ replies, xml ) Need Help??


in reply to Re: Removing double carriage return
in thread Removing double carriage return

actually:

perl -i.bak -0777pe 's/\n\n/\n/g' inputtext

may be sightly better as no byte value matches octal 777, although that's rather nit picking and I'd have not noticed if I hadn't have needed to look up perlrun to find out what -0 (the digit 0 btw) actually does. ;)

True laziness is hard work


Comment on Re^2: Removing double carriage return
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (12)
As of 2015-07-06 16:37 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 (77 votes), past polls