Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re: win2unix

by atcroft (Abbot)
on Jul 20, 2002 at 08:08 UTC ( [id://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?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others lurking in the Monastery: (3)
As of 2024-12-09 07:42 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Which IDE have you been most impressed by?













    Results (53 votes). Check out past polls.