Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re (tilly) 1: Removing Carriage returns from text files

by tilly (Archbishop)
on Oct 17, 2001 at 23:38 UTC ( [id://119525]=note: print w/replies, xml ) Need Help??


in reply to Removing Carriage returns from text files

This is from memory, without a machine to test it on.
perl -pi.bak -e "BEGIN{binmode(STDOUT)}" file1 file2
UPDATE
Erk, the above doesn't work. You could do it like this:
perl -pe "BEGIN {binmode(STDOUT)}" < in_file > out_file
or probably like this:
perl -pi.bak -e "binmode ARGVOUT" file1 file2
The idea being that you are reading in with the usual \r\n to \n conversion, and then you print out without that conversion. (Thereby dropping the "\r".)

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (5)
As of 2024-04-19 22:36 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found