From owner-freebsd-questions@FreeBSD.ORG Sun May 7 23:49:24 2006 Return-Path: X-Original-To: freebsd-questions@freebsd.org Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 64EDB16A408 for ; Sun, 7 May 2006 23:49:24 +0000 (UTC) (envelope-from MTaylor@bytecraft.com.au) Received: from wolf.bytecraft.au.com (wolf.bytecraft.au.com [203.39.118.1]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2351043D45 for ; Sun, 7 May 2006 23:49:22 +0000 (GMT) (envelope-from MTaylor@bytecraft.com.au) Received: from localhost (localhost [127.0.0.1]) by wolf.bytecraft.au.com (8.12.11/8.12.11) with ESMTP id k47NnDp3074892; Mon, 8 May 2006 09:49:13 +1000 (EST) (envelope-from MTaylor@bytecraft.com.au) Received: from wolf.bytecraft.au.com ([127.0.0.1]) by localhost (wolf.bytecraft.au.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 73946-03; Sun, 7 May 2006 23:49:13 +0000 (GMT) Received: from svmarshal.bytecraft.au.com ([10.0.0.4]) by wolf.bytecraft.au.com (8.12.11/8.12.11) with ESMTP id k47NnB5p074885; Mon, 8 May 2006 09:49:12 +1000 (EST) (envelope-from MTaylor@bytecraft.com.au) Received: from svmailmel.bytecraft.internal (Not Verified[10.0.0.24]) by svmarshal.bytecraft.au.com with MailMarshal (v5, 0, 3, 78) id ; Mon, 08 May 2006 09:49:11 +1000 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable X-MimeOLE: Produced By Microsoft Exchange V6.5.7226.0 Date: Mon, 8 May 2006 09:49:10 +1000 Message-ID: <04E232FDCD9FBE43857F7066CAD3C0F117C8BA@svmailmel.bytecraft.internal> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: Substitute command on vi Thread-Index: AcZwayELSbm+DLfmR8aadGfnbmozFABxQMIA From: "Murray Taylor" To: "Denis R." , Cc: freebsd-questions@freebsd.org Subject: RE: Substitute command on vi X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 May 2006 23:49:24 -0000 This is a good vi incantation (NB The ^V is only there to allow you to put in the ^M. The ^V doesnt=20 show in the final command line, so dont panic that you cant see it) :g/^V^M/s///g ie g/^V^M/ - find a ^M (any one will do, you dont need to be at the file start) s/// - substitute nothing for the ^M just found g - do this to all other ^M's mjt -- "Any intelligent fool can make things bigger and more complex... It takes a touch of genius - and a lot of courage to move in the opposite direction." =20 Albert Einstein=20 --=20 > -----Original Message----- > From: owner-freebsd-questions@freebsd.org=20 > [mailto:owner-freebsd-questions@freebsd.org] On Behalf Of Denis R. > Sent: Saturday, 6 May 2006 3:40 AM > To: magalhj@yahoo.com.br > Cc: freebsd-questions@freebsd.org > Subject: re: Substitute command on vi >=20 > Try > #dos2unix file_name >=20 > >>>>>>>>>> > Hi list, >=20 > I need to substitute a lot of characters ^M (ctrl+M) at the=20 > end of each line in my file. >=20 > The command :%s/^M//g insn't have success. >=20 > How can i do it ? >=20 > Thanks, >=20 > Aguiar --------------------------------------------------------------- The information transmitted in this e-mail is for the exclusive use of the intended addressee and may contain confidential and/or privileged material. Any review, re-transmission, dissemination or other use of it, or the taking of any action in reliance upon this information by persons and/or entities other than the intended recipient is prohibited. If you received this in error, please inform the sender and/or addressee immediately and delete the material.=20 E-mails may not be secure, may contain computer viruses and may be corrupted in transmission. Please carefully check this e-mail (and any attachment) accordingly. No warranties are given and no liability is accepted for any loss or damage caused by such matters. --------------------------------------------------------------- ***This Email has been scanned for Viruses by MailMarshal.***