From owner-freebsd-questions@FreeBSD.ORG Sat Jan 10 14:25:40 2004 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 54E0316A4D4 for ; Sat, 10 Jan 2004 14:25:40 -0800 (PST) Received: from neostrada.pl (pv78.neoplus.adsl.tpnet.pl [80.50.53.78]) by mx1.FreeBSD.org (Postfix) with ESMTP id 9BE0943D6B for ; Sat, 10 Jan 2004 14:25:22 -0800 (PST) (envelope-from zaphod@neostrada.pl) Received: by neostrada.pl (Postfix, from userid 1001) id 4ED0240C4; Sat, 10 Jan 2004 23:21:46 +0100 (CET) Date: Sat, 10 Jan 2004 23:21:46 +0100 From: Bernard El-Hagin To: Gary Kline Message-ID: <20040110222146.GB711@hoth> References: <20040110221036.GA44130@tao.thought.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20040110221036.GA44130@tao.thought.org> User-Agent: Mutt/1.4.1i cc: freebsd-questions@freebsd.org Subject: Re: perl script question. 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: Sat, 10 Jan 2004 22:25:40 -0000 Gary Kline wrote: > > Folks, > > Let's see if perl can do this one; it's as obscure a task > as I've run into. I have scores of files with: > > A regular sentence, or phrase. then_one_containing_underscores_- > between_each_word Followed by another regular, space-delimited > sentence. Followed_by_another_string_with_underscaores. > > Is there a perl way to get rid of the > string_containing_underscores and leave the regular sntences?? > > Any thoughts very welcome!! Perhaps this will be enough: % perl -i.bak -pe 'tr/_/ /' -- Cheers, Bernard