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