Deleting ^M with vi

From: Garry Optland <garry_at_pp.nsw.gov.au>
Date: Fri, 21 Feb 1997 20:32:34 +1100 (EST)

Is there an easy way to delete carriage returns (^M) in vi? I am editing
some html files created on a PC, and they annoy me :-)

I tried :%s/^M//g but I get a substitute pattern match failed message,
probably because I'm entering shift-6 and shift-m as two characters. I
also tried \r, but that deletes all r's from the file.

Regards,
         Garry.

--------------------------------------------------------------------
Garry Optland Unix-Internet-CGI-Security
Email: garry_at_pp.nsw.gov.au phone: +61 2 9268 6160
Pacific Power, Park & Elizabeth Streets, Sydney, NSW 2001 Australia
--------------------------------------------------------------------
Received on Fri Feb 21 1997 - 10:58:01 NZDT

This archive was generated by hypermail 2.4.0 : Wed Nov 08 2023 - 11:53:47 NZDT