Beefy Boxes and Bandwidth Generously Provided by pair Networks Joe
P is for Practical
 
PerlMonks  

RE: Remove the ^M Character from a Document

by Anonymous Monk
on Mar 22, 2000 at 19:12 UTC ( [id://5912]=note: print w/replies, xml ) Need Help??

This is an archived low-energy page for bots and other anonmyous visitors. Please sign up if you are a human and want to interact.


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 04: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 19: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
Domain Nodelet?
Node Status?
node history
Node Type: note [id://5912]
help
Sections?
Information?
Find Nodes?
Leftovers?
    Notices?
    hippoepoptai's answer Re: how do I set a cookie and redirect was blessed by hippo!
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.