From owner-freebsd-questions@FreeBSD.ORG Sat Jan 10 15:37:03 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 4ACB816A4CE for ; Sat, 10 Jan 2004 15:37:03 -0800 (PST) Received: from smtp.infracaninophile.co.uk (smtp.infracaninophile.co.uk [81.2.69.218]) by mx1.FreeBSD.org (Postfix) with ESMTP id 93E1943D68 for ; Sat, 10 Jan 2004 15:36:52 -0800 (PST) (envelope-from m.seaman@infracaninophile.co.uk) Received: from happy-idiot-talk.infracaninophile.co.uk (localhost [IPv6:::1]) i0ANajfn005834 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sat, 10 Jan 2004 23:36:45 GMT (envelope-from matthew@happy-idiot-talk.infracaninophile.co.uk) Received: (from matthew@localhost)id i0ANajTX005833; Sat, 10 Jan 2004 23:36:45 GMT (envelope-from matthew) Date: Sat, 10 Jan 2004 23:36:45 +0000 From: Matthew Seaman To: Marty Landman Message-ID: <20040110233645.GA5668@happy-idiot-talk.infracaninophile.co.uk> Mail-Followup-To: Matthew Seaman , Marty Landman , FreeBSD Mailing List , Gary Kline References: <20040110221036.GA44130@tao.thought.org> <20040110223308.GA4881@happy-idiot-talk.infracaninophile.co.uk> <20040110223907.GA16659@Uruk-Hai.Sanitarium.mine.nu> <20040110230218.GA5347@happy-idiot-talk.infracaninophile.co.uk> <6.0.0.22.0.20040110182450.0a09ce58@pop.face2interface.com> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="BXVAT5kNtrzKuDFl" Content-Disposition: inline In-Reply-To: <6.0.0.22.0.20040110182450.0a09ce58@pop.face2interface.com> User-Agent: Mutt/1.5.5.1i X-Spam-Status: No, hits=-4.9 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=2.61 X-Spam-Checker-Version: SpamAssassin 2.61 (1.212.2.1-2003-12-09-exp) on happy-idiot-talk.infracaninophile.co.uk cc: Gary Kline cc: FreeBSD Mailing List 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 23:37:03 -0000 --BXVAT5kNtrzKuDFl Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sat, Jan 10, 2004 at 06:26:30PM -0500, Marty Landman wrote: > At 06:02 PM 1/10/2004, Matthew Seaman wrote: > >On Sat, Jan 10, 2004 at 11:39:07PM +0100, Bj=F6rn Andersson wrote: > > > >> If this occures more than once on a line we should have the line as th= is: > >> perl -pi.bak -e 's/\s+\w+_\w+\.?//g;' filename > > > >Good point. Also, if the stuff_separated_by_underscores wraps around > >onto more than one line, then there may not be any leading whitespace: >=20 > I don't see why the translate sol'tn that Gary Kline gave first isn't=20 > adequate. Err --- Gary Kline was the OP asking how to do this: I think you mean=20 Bernard El-Hagin's solution? % perl -i.bak -pe 'tr/_/ /' That doesn't do the right thing. It turns: "This is a sample ordinary sentence. This_is_joined_up_with_underscore= s." into: "This is a sample ordinary sentence. This is joined up with underscore= s." but the requirement is to produce: "This is a sample ordinary sentence." Cheers, Matthew=09 --=20 Dr Matthew J Seaman MA, D.Phil. 26 The Paddocks Savill Way PGP: http://www.infracaninophile.co.uk/pgpkey Marlow Tel: +44 1628 476614 Bucks., SL7 1TH UK --BXVAT5kNtrzKuDFl Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.4 (FreeBSD) iD8DBQFAAIyNdtESqEQa7a0RAqjdAJwKxNKS2Q6h5rU1CjeKEi6HUWTsIACdHG18 ArHSjsQHzRqs8ewzObWwnVM= =eNso -----END PGP SIGNATURE----- --BXVAT5kNtrzKuDFl--