From owner-freebsd-questions Mon Jan 11 01:57:02 1999 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id BAA09130 for freebsd-questions-outgoing; Mon, 11 Jan 1999 01:57:02 -0800 (PST) (envelope-from owner-freebsd-questions@FreeBSD.ORG) Received: from mail.sysnet.net.tw (mail.sysnet.net.tw [210.67.33.9]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id BAA09124 for ; Mon, 11 Jan 1999 01:56:59 -0800 (PST) (envelope-from kevlo@hello.com.tw) Received: from hello.com.tw (p210-67-40-145.ts.sysnet.net.tw [210.67.40.145]) by mail.sysnet.net.tw (8.8.8/8.8.8) with ESMTP id RAA10107; Mon, 11 Jan 1999 17:56:04 +0800 (CST) Message-ID: <3699CAA3.559953BA@hello.com.tw> Date: Mon, 11 Jan 1999 17:55:47 +0800 From: Kevin Lo X-Mailer: Mozilla 4.5 [en] (X11; I; FreeBSD 2.2.8-RELEASE i386) X-Accept-Language: en MIME-Version: 1.0 To: charon@freethought.org CC: freebsd-questions@FreeBSD.ORG Subject: Re: replacing ^M in vi References: <3.0.5.32.19990110225910.00a2f220@mail> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG charon@freethought.org wrote: > 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, Use this command at the prompt: tr -d "\015" < filename1 > filename2 Hope this helps, Kevin. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message