From owner-freebsd-questions Fri Jun 8 8:49:41 2001 Delivered-To: freebsd-questions@freebsd.org Received: from mail.pcintelligent.com (dsl081-221-003.nyc1.dsl.speakeasy.net [64.81.221.3]) by hub.freebsd.org (Postfix) with ESMTP id 352F537B406 for ; Fri, 8 Jun 2001 08:49:32 -0700 (PDT) (envelope-from kenn@pcintelligent.com) Received: from web.pcintelligent.com (IDENT:kenn@web.pcintelligent.com [64.81.221.3]) by mail.pcintelligent.com (8.9.3/8.9.3) with ESMTP id LAA01224; Fri, 8 Jun 2001 11:11:02 -0400 Date: Fri, 8 Jun 2001 11:11:02 -0400 (EDT) From: Ken Nagorski To: Alex Dyas Cc: David Leimbach , questions@FreeBSD.ORG Subject: RE: __ how to eliminate "^M" in ASCII files. In-Reply-To: <911D8F660DF6D411B61F00500462BA019261CC@EXCHANGE> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII 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 Hi there, How about vi anyone? :%s/^M//g Let me explain that. While not in insert mode hit :%s/ Then hold donw the control key and hit v (crtl +v) This tells vi/sed that the next charater coming is a control char While still holding down the control key hit m then hit //g this say replace it ith nothing globally. I hoped that helped, please remeber if you aren't using vi you shouldn't be using Unix :) Ken! On Fri, 8 Jun 2001, Alex Dyas wrote: > > cat file | tr '\015' ' ' > > > > all ^M replaced with spaces... maybe not the best example. > > cat file | tr -d '\015' > > gets rid of them. > > alex... > > To Unsubscribe: send mail to majordomo@FreeBSD.org > with "unsubscribe freebsd-questions" in the body of the message > -- IMPORTANT: This email is intended for the use of the individual addressee(s) named above and may contain information that is confidential, privileged or unsuitable for overly sensitive persons with low self-esteem, no sense of humour or irrational religious beliefs. If you are not the intended recipient, any dissemination, distribution or copying of this email is not authorised (either explicitly or implicitly) and constitutes an irritating social faux pas. Unless the word absquatulation has been used in its correct context somewhere other than in this warning, it does not have any legal or no grammatical use and may be ignored. No animals were harmed in the transmission of this email, although the kelpie next door is living on borrowed time, let me tell you. Those of you with an overwhelming fear of the unknown will be gratified to learn that there is no hidden message revealed by reading this warning backwards, so just ignore that Alert Notice from Microsoft. However, by pouring a complete circle of salt around yourself and your computer you can ensure that no harm befalls you and your pets. If you have received this email in error, please add some nutmeg and egg whites, whisk and place in a warm oven for 40 minutes. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message