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

Re: win2unix

by atcroft (Abbot)
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.

Replies are listed 'Best First'.
Re: Re: win2unix
by ackohno (Scribe) on Jul 20, 2002 at 08:15 UTC
    ::slams head on keyboard::
    talk about embarrasing...

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://183569]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (2)
As of 2018-03-22 08:34 GMT
Find Nodes?
    Voting Booth?
    When I think of a mole I think of:

    Results (273 votes). Check out past polls.