Dear All, Thanks very much for the overwhelming number of responses. Needless to say, this looks to be one of the oldest issues around. I got tons of different (similar in concept) solutions, and I've taken a few minutes to acknowledge everyone and their lines of solution. For me, a vi fan, the clue was to get ^M by typing Ctrl-V-Ctrl-M. thanks all. Sauri First: Original Posting, then summary (which is very long): ********************************************************************* hi folks, when one transfers text files from windows to unix systems, carriage returns get appended at the end of lines as ^M character. I would like to remove this. Is there some simple shell command? (I do search and replace operations on various editors...) thanks a lot.. -sauri ******************************************************************* Howard Arnold arnoldh@celerent.com "Hajnik Ferenc" FHajnik@suzuki.hu "Dewhurst, Cy" cy.dewhurst@rbch-tr.swest.nhs.uk "Pat Charron" charron@zk3.dec.com "Kraft, Wolfram" Kraft.Wolfram@erdoelchemie.de "Binkley Robert - rbinkl" Robert.Binkley@acxiom.com Lawrie Smith lawrie.smith@capita.co.uk Using VI or sed you can do a g/ ^M/s///g to get rid of the control M's (^M). The ^M is typed by doing Ctrl-V-Ctrl-M. � This was the clue I was looking for. Xavier Mertens xavier@be.wanadoo.com Robert M Lang lang@isis.mit.edu "Moore, Ric" Ric.Moore@msfc.nasa.gov Jason Neil" jason_neil@yahoo.com "Phil Farrell" farrell@pangea.Stanford.EDU "Prasad, Sreenivasa" sreenivasa.prasad@digital.com "Bob Marcan" bob.marcan@aster.si Suggested the use of the tr command cat | tr -d "^M" > either as cat inputfilename | tr -d "\015" > outputfilename (different ways of representing "^M") "Lucio Chiappetti" lucio@ifctr.mi.cnr.it had a detailed answer, and pointed out that this occurs only when one shares files, rather than transfers them. So using an ftp or other ascii transfer method shouldn't cause this, but sharing causes the problem. You are right. We use nfs share between the machines. I got a few scripts on the lines of: (using troff, perl etc) prompt > type /scriptdir/removecr #!/bin/csh -f foreach i ($argv) tr -d '\015' < $i > temp.temp mv -i temp.temp $i end prompt > type /scriptdir/unix2dos [to add the CR] #/bin/csh -f sed -e 's/$/^M/' $1 > $2 Mark Bowman" mb301@hotmail.com also suggested using transfer methods rather than share. http://www.ipswitch.com/Products/WS_FTP/index.html � get WSFtp from them. "Michael A. Crowley" mcrowley@MtHolyoke.edu suggested downloading ftp software fromm ftp.trentu.ca shortest solution: "Gavin Kreuiter" gavin@transactive.usko.com The easiest is col: col unixfile "John Venier" venier@odin.mdacc.tmc.edu "Chris Ruhnke" ruhnke@us.ibm.com Peter Stern Peter.Stern@weizmann.ac.il "B�rd_Tesaker" bt@chembio.ntnu.no Michael Breen" mike@machinerebel.com "Kevin Binda" bindak@brandonRHA.mb.ca "Cathy Chandra" suggested perl scripts such as perl -p -i.dos -e 's/\r//g;' file and #! /usr/bin/perl -pi.dosbak s/\r\n$/\n "Joe Fletcher" joe@meng.ucl.ac.uk "Eric M. Sisson" ems@mdacc.tmc.edu pointed out that mtools has a built in dos2unix and unix2dos functions and that Tru64 5.x comes with mtools installed. __________________________________________________ Do You Yahoo!? Make a great connection at Yahoo! Personals. http://personals.yahoo.com