tru64-unix-managers (formerly alpha-osf-managers) (1994-2012)
 help / color / mirror / Atom feed
* SUMMARY: remove ^M from a file
@ 2002-05-10 20:07 Vincent.D'Antonio
  0 siblings, 0 replies; only message in thread
From: Vincent.D'Antonio @ 2002-05-10 20:07 UTC (permalink / raw)


WOW, I received responds faster then my own mail was sent to me ( which I
am still waiting to see ).  Here are some replies.

thanks to:

Tripathi, Ashish    cat file | col -b > new file name

Phil Farrell   The simplest way I know is to use "tr" to delete the CTRL-M
characters,
using the octal code from the ASCII chart to specify it, for example,

tr -d '\015' < original_file > new_fixed_copy

Ballowe, Charles    cat <file> | sed -e 's/Ctrl-vCtrl-m//' >> <file>.new ;
mv <file>.new <file>

Paul A Sand    I use:

     perl -pi -e 's/\r//g;' filename

(Removes them everywhere)

If you want them replaced with Unix newlines:

     perl -pi -e 's/\r/\n/g;' filename

I think there's probably a way to do it with sed too.

Kurt A. Ludwig there should be a utility called dos2unix that will take
care of it.

Peter Mittermayer, and Xavier Mertens    sed "s/^M$//g" <infile >outfile

John Venier    # tr -d '\r' < oldfile > newfile

?

Warning: this does not limit the removal of the ^M to the ends of
lines; it removes all of them.

plus many more, I thank all who replied.

thanks again
Vince

---------------------------------------------------------------------------------------------------------

Vincent D'Antonio
Unix Systems Engineer
Bisys Retirement Services
200 Dryden Road
Dresher, PA 19025

phone: 215-542-2555
fax:        215-542-2603
e-mail:  Vincent.D'Antonio@bisys.com





^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2002-05-10 20:07 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-05-10 20:07 SUMMARY: remove ^M from a file Vincent.D'Antonio

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox