in reply to Remove the ^M Character from a Document

If you are trying to do this substitution from the command line you could just use dos2unix/unix2dos. (on Unix box - I think the commands are available on all flavours(?))
  • 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 Anonymous Monk on Jul 12, 2000 at 07:36 UTC

    if you need to strip it from all the *.html files in a directory, try this sh snippet:

    for A in *.html; do if [ -f $A ]; then sed -e 's/^V^M//g' $A > /tmp/foo.$$; mv /tmp/foo.$$ $A; fi;done

    it's not perl, so sue me :-P

    edit by mirod: added code tags