From owner-freebsd-questions Mon Jan 11 04:06:51 1999 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id EAA23742 for freebsd-questions-outgoing; Mon, 11 Jan 1999 04:06:51 -0800 (PST) (envelope-from owner-freebsd-questions@FreeBSD.ORG) Received: from gccomm.net (gccomm.net [207.8.142.138]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id EAA23734 for ; Mon, 11 Jan 1999 04:06:49 -0800 (PST) (envelope-from admin@gccomm.net) Received: from tvmaster (tvmaster2.whyy.org [207.245.66.49]) by gccomm.net (8.8.8/8.8.7) with SMTP id GAA16149 for ; Mon, 11 Jan 1999 06:52:11 -0500 (EST) (envelope-from admin@gccomm.net) Message-ID: <003e01be3d5a$c2034de0$3142f5cf@whyy.org> From: "Jeff Ehrenkrantz" To: Subject: After the fact replacing ^M Date: Mon, 11 Jan 1999 07:05:30 -0500 MIME-Version: 1.0 Content-Type: text/plain; charset="Windows-1252" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 5.00.0810.800 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.0810.800 Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG here is an "after the fact" perl script that will strip the code from a text file and copy the original to *.prevyou will have to use it on itself if you use msdos to transfer the file. #!/usr/bin/perl -pi.prev s/\015/\n/g ; ----- Original Message ----- From: To: Sent: Monday, January 11, 1999 1:59 AM Subject: replacing ^M in vi Whenever I save a plain text file in WinNT and open it in FreeBSD, at the end of every line is a "^M". How do I get rid of these? I tried writing a little C++ program to copy all text except "^M" to another file, but it doesn't work because C++ treats the ^ and the M as different characters, whereas vi treats them as _one_ character. After searching the mailing list archives, I came up with the syntax ":%s/stuff/other stuff/g" as the oh-so-intuitive replace command in vi, and I tried it, but to no avail (it says "no match found"). Any suggestions? Thanks, Charon@freethought.org http://members.home.net/tuathadedanann/ alt.sex.fetish.hamster.duct-tape To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message