Removing ^M

Dave Reed dreed at capital.edu
Sat Jun 8 10:48:51 EDT 2002


> X-Authentication-Warning: localhost.localdomain: olc owned process doing -bs
> From: Michael Hall <olc at ninti.com>
> X-Sender: olc at localhost.localdomain
> Date: Sun, 9 Jun 2002 10:08:44 +0930 (CST)
> 
> 
> 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

There's a program called dos2unix that will do this. From your mail
headers it looks to me like you have a Unix/Linux system in which case
it may already be installed. If not do a google search on dos2unix.

Dave






More information about the Python-list mailing list