Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re: Strip line feeds from file

by thelenm (Vicar)
on Jun 09, 2003 at 20:14 UTC ( [id://264447]=note: print w/replies, xml ) Need Help??


in reply to Strip line feeds from file

Something like this might be what you're looking for:

perl -pi.bak -e 's/[\n\r]+//g' myfile

This will strip all the carriage returns and linefeeds and then overwrite the original file. A backup file will be created with a .bak extension, just in case.

-- Mike

--
just,my${.02}

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others chilling in the Monastery: (3)
As of 2024-04-19 23:37 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found