[Gllug] simple sed question

Simon Stewart sms at lateral.net
Mon Oct 15 10:37:06 UTC 2001


On Mon, Oct 15, 2001 at 11:07:30AM +0100, robin.c.smith at bt.com wrote:
> We have a program that generates a log file and sometimes this log file gets
> a bit corrupted and splits the line up with
> ^M (control-M) at the end. How do I get rid of the ^M and join the lines in
> sed?

The "control-M" is probably a carriage return. You could do something
like:

tr -d '\r' <logfile >outfile  # Deletes all the carriage returns

or 

tr '\r' ' ' <logfile >outfile # Translates the \r to a space.

Cheers,

Simon

-- 
"I lost a button hole today." --- Steven Wright

-- 
Gllug mailing list  -  Gllug at linux.co.uk
http://list.ftech.net/mailman/listinfo/gllug




More information about the GLLUG mailing list