From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Vincent.D'Antonio@bisys.com Newsgroups: gmane.os.tru64.managers Subject: SUMMARY: remove ^M from a file Date: Fri, 10 May 2002 16:07:48 -0400 Sender: tru64-unix-managers-owner@ornl.gov Message-ID: NNTP-Posting-Host: localhost.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: main.gmane.org 1021061933 26997 127.0.0.1 (10 May 2002 20:18:53 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Fri, 10 May 2002 20:18:53 +0000 (UTC) Return-path: Original-Received: from sws1.ctd.ornl.gov ([160.91.20.101]) by main.gmane.org with smtp (Exim 3.33 #1 (Debian)) id 176Gqr-00071K-00 for ; Fri, 10 May 2002 22:18:53 +0200 Original-Received: (qmail 1258 invoked by uid 5); 10 May 2002 20:12:23 -0000 Original-Followup-To: poster Precedence: bulk Original-Received: (qmail 1250 invoked from network); 10 May 2002 20:12:23 -0000 Original-Received: from unknown (HELO emroute2.cind.ornl.gov) (128.219.159.41) by 0 with SMTP; 10 May 2002 20:12:23 -0000 Original-Received: from emroute2.cind.ornl.gov (LOCALHOST [127.0.0.1]) by emroute2.cind.ornl.gov (PMDF V6.1-1 #39060) with ESMTP id <0GVW00GCAW4N38@emroute2.cind.ornl.gov> for tru64-unix-managers@sws1.ctd.ornl.gov (ORCPT tru64-unix-managers@ornl.gov) ; Fri, 10 May 2002 16:12:23 -0400 (EDT) Original-Received: from ntpromail2.bps.com ([205.166.36.66]) by emroute2.cind.ornl.gov (PMDF V6.1-1 #39060) with ESMTP id <0GVW007A9W49MT@emroute2.cind.ornl.gov> for tru64-unix-managers@sws1.ctd.ornl.gov (ORCPT tru64-unix-managers@ornl.gov) ; Fri, 10 May 2002 16:12:09 -0400 (EDT) Original-To: tru64-unix-managers@ornl.gov X-Mailer: Lotus Notes Release 5.0.8 June 18, 2001 X-MIMETrack: Serialize by Router on NTPROMAIL2/BISYS_BPS(Release 5.0.8 |June 18, 2001) at 05/10/2002 04:08:00 PM Xref: main.gmane.org gmane.os.tru64.managers:147 X-Report-Spam: http://spam.gmane.org/gmane.os.tru64.managers:147 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 | sed -e 's/Ctrl-vCtrl-m//' >> .new ; mv .new 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" 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