From owner-freebsd-questions@FreeBSD.ORG Mon Nov 24 07:47:04 2003 Return-Path: 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 CAAC816A4CE for ; Mon, 24 Nov 2003 07:47:04 -0800 (PST) Received: from CITADEL.NOBULUS.COM (citadel.nobulus.com [212.97.207.19]) by mx1.FreeBSD.org (Postfix) with ESMTP id 8BE9B43FCB for ; Mon, 24 Nov 2003 07:47:00 -0800 (PST) (envelope-from iva@orange.dk) Received: from CITADEL.NOBULUS.COM (localhost [127.0.0.1]) by CITADEL.NOBULUS.COM (8.12.10/8.12.10) with ESMTP id hAOFjSu5049869 for ; Mon, 24 Nov 2003 16:45:28 +0100 (CET) (envelope-from iva@CITADEL.NOBULUS.COM) Received: (from iva@localhost) by CITADEL.NOBULUS.COM (8.12.10/8.12.10/Submit) id hAOFjSQ5049868 for freebsd-questions@freebsd.org; Mon, 24 Nov 2003 16:45:28 +0100 (CET) (envelope-from iva) Date: Mon, 24 Nov 2003 16:45:28 +0100 From: Ilya Varlashkin To: freebsd-questions@freebsd.org Message-ID: <20031124154528.GA49695@CITADEL.NOBULUS.COM> References: <3FBF5DEA.2030405@hotmail.com> <017801c3b297$e8404dc0$fa65a8c0@ocfl061> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <017801c3b297$e8404dc0$fa65a8c0@ocfl061> X-Scanned-By: CITADEL.NOBULUS.COM Subject: Re: newbie: use in RE? X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 Nov 2003 15:47:04 -0000 > ----- Original Message ----- > From: "Zhang Weiwu" > To: > Sent: Saturday, November 22, 2003 8:00 AM > Subject: newbie: use in RE? > > > > Hello. Just want to know how to use special character in Regular > Expression. > > > > I wish to remove all the carrier returns from a text file, I can use: > > tr -d "\r" < text_file > modified_text_file > > But if I do: > > sed -i s/\r//g text_file > > it actually removes all the character "r" from the file. > > > > This is also a problem in vi(1). Besides I wish to manipulate > > tabstops and line-feeds with RE too. > > Depending on file size I use either vi in command mode :g/^M/s///g where is result of pressing Ctrl-V then Ctrl-M. Or for big files: sed 's/^M//' myfile.txt Hope this helps. Kind regards, Ilya Varlashkin > > _______________________________________________ > > freebsd-questions@freebsd.org mailing list > > http://lists.freebsd.org/mailman/listinfo/freebsd-questions > > To unsubscribe, send any mail to > "freebsd-questions-unsubscribe@freebsd.org" > > > > > _______________________________________________ > freebsd-questions@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-questions > To unsubscribe, send any mail to "freebsd-questions-unsubscribe@freebsd.org" > >