From owner-freebsd-questions Wed May 8 10:25:50 2002 Delivered-To: freebsd-questions@freebsd.org Received: from smtp.mailix.net (smtp.mailix.net [216.148.213.132]) by hub.freebsd.org (Postfix) with ESMTP id 122C137B401 for ; Wed, 8 May 2002 10:25:47 -0700 (PDT) Received: from [12.246.2.224] (helo=brown) by smtp.mailix.net with asmtp (Exim 4.01) id 175VBt-0006bn-00; Wed, 08 May 2002 10:25:25 -0700 Date: Wed, 8 May 2002 10:26:00 -0700 From: Philip Southam To: scottro@despammed.com Cc: shubhamr@malkauns.nsc.com, questions@FreeBSD.ORG Subject: Re: such a pain Message-Id: <20020508102600.2f925d3d.freebsd@philipsoutham.net> In-Reply-To: <20020505054149.GA2060@scott1.homeunix.net> References: <3CD4B6D2.9858CAE0@malkauns.nsc.com> <20020505054149.GA2060@scott1.homeunix.net> X-Mailer: Sylpheed version 0.7.5 (GTK+ 1.2.10; i386-portbld-freebsd4.5) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Sun, 5 May 2002 00:41:49 -0500 scottro@despammed.com wrote: > On Sun, May 05, 2002 at 10:06:34AM +0530, shubhamr wrote: > > Hi, > > I have some .c files which I got from my windows machine.But when I read > > it on BSD,for every line end ^M shows up,whereever there is a > > newline(carriage return).It is tedious to remove them manually.I have no > > X installed on my BSD.Can anyone suggest how to get rid of them? > > > > shubha > > In BSD, open the file with the vi editor > > vi > > Once you have it there type > > :%s/ctrl +V ctrl+ M//g > > That will do it. > The ctrl + V tells it to enter the next character > literally---otherwise, the ctrl + M wouldn't show up. > > HTH > > Scott Robbins > > To Unsubscribe: send mail to majordomo@FreeBSD.org > with "unsubscribe freebsd-questions" in the body of the message > You may also want to try dos2unix, it's worked to remove those pesky ^M's for me. #dos2unix file.txt It's located in /usr/ports/converters/unix2dos/ Philip To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message