Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re: win2unix

by atcroft (Monsignor)
on Jul 20, 2002 at 08:08 UTC ( #183569=note: print w/ replies, xml ) Need Help??


in reply to win2unix

perl -p -i.bak -e "s/\r//" filename loops thru filename, removing the ^M characters (\r), and creates a backup with .bak appended to the filename-a commonly used one-liner to do the same thing. (.bak could be replaced with something else, or left off if no backup is desired)

Update: No need to feel embarassed-I would be willing to bet that most of us have written a script to do that same thing before. Appreciate the fact that you looked at a problem and came up with a good solution which dealt relatively effectively with contingencies, and chalk it up to practice in growing in your abilities to use perl effectively. Reinventing the wheel isn't always bad, if you gain a better understanding of that wheel and don't try to reinvent the same one too often.


Comment on Re: win2unix
Download Code
Re: Re: win2unix
by ackohno (Scribe) on Jul 20, 2002 at 08:15 UTC
    ::slams head on keyboard::
    talk about embarrasing...

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (12)
As of 2014-07-23 15:38 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (145 votes), past polls