Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!uunet!snorkelwacker!bloom-beacon!athena.mit.edu!jik From: jik@athena.mit.edu (Jonathan I. Kamens) Newsgroups: comp.unix.questions Subject: Re: ^M 's in uploaded text files. Keywords: Help! Message-ID: <1990Feb1.164704.23581@athena.mit.edu> Date: 1 Feb 90 16:47:04 GMT References: <5622@udccvax1.acs.udel.EDU> Sender: news@athena.mit.edu (News system) Reply-To: jik@athena.mit.edu (Jonathan I. Kamens) Distribution: usa Organization: Massachusetts Institute of Technology Lines: 24 In article <5622@udccvax1.acs.udel.EDU>, william@vax1.acs.udel.EDU (William H. York) writes: > I use my PC to write text files in word perfect then I save in dos format > to upload to our vax. When the file is cat'ed, the ^M's don't show, but > when vi'ing they become real annoying! Is there a file I can pipe it > through to remove the ^M's or perhaps a way vi can be used to remove them? Many versions of the "tr" program will allow you to specify control characters in the strings passed to tr, and to use the -d option to tell it to delete any characters in the first string. Therefore, to delete all the ^M characters in a file, you could do tr -d "\012" < filename > filename.new Note that your version of tr may require that you use "[\012]" instead of just "\012". I don't know how to do it in vi; I use emacs :-) ("M-x replace-string ^Q ^M "). Jonathan Kamens USnail: MIT Project Athena 11 Ashford Terrace jik@Athena.MIT.EDU Allston, MA 02134 Office: 617-253-8495 Home: 617-782-0710