Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

RE: Remove the ^M Character from a Document

by Anonymous Monk
on Mar 23, 2000 at 00:12 UTC ( #5912=note: print w/replies, xml ) Need Help??


in reply to Remove the ^M Character from a Document

If you're in a Unix environment (where \n is the EOL char) you can just as easily do: perl -pi -e 's/\r//g' <file name> This works because in DOS, EOL is represented at \r\n.
  • Comment on RE: Remove the ^M Character from a Document

Replies are listed 'Best First'.
RE: RE: Remove the ^M Character from a Document
by Novician (Novice) on Jun 05, 2000 at 08:05 UTC
    Not sure why the ones mentioned above does not work. but yours do :D thanz. Wiseness does not come with age, but
    with the mind to realise...
Re: RE: Remove the ^M Character from a Document
by Anonymous Monk on Oct 17, 2001 at 23:14 UTC
    What if you are in a DOS environment and you want to remove what will become the offending ^M when the file is opened in Unix? Running the search and replace doesn't do anything. You still end up with the carriage return instead of the linefeed

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://5912]
help
Chatterbox?
and the questions are moot...

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (8)
As of 2018-06-19 17:04 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Should cpanminus be part of the standard Perl release?



    Results (114 votes). Check out past polls.

    Notices?