Removing ^M

so very tired g0riaman at cdf.toronto.edu
Tue Jun 11 10:31:54 EDT 2002


Easiest way to do this is with sed.
cat file.html | sed 's/^M//g' > newfile.html

the trick is you have to enter ^M as the proper control character.
You can do this at the command prompt by holding down CTRL+SHIFT and then
hitting V and M in sequence.
This should work with other control characters as well.
Hope this helps.
mRiaz

On Sun, 9 Jun 2002, Michael Hall wrote:

>
> I am trying remove ^M characters (some kind of newline character) from an
> HTML file. I've tried all sorts of string.replace and sed possibilities
> but the
> things just won't go away. Does anyone have a way of removing such
> characters?
>
> TIA
>
> Mick
>
>
>
>
>




More information about the Python-list mailing list