Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 10 Jan 2004 22:33:08 +0000
From:      Matthew Seaman <m.seaman@infracaninophile.co.uk>
To:        Gary Kline <kline@thought.org>
Cc:        FreeBSD Mailing List <freebsd-questions@freebsd.org>
Subject:   Re: perl script question.
Message-ID:  <20040110223308.GA4881@happy-idiot-talk.infracaninophile.co.uk>
In-Reply-To: <20040110221036.GA44130@tao.thought.org>
References:  <20040110221036.GA44130@tao.thought.org>

next in thread | previous in thread | raw e-mail | index | archive | help

--uAKRQypu60I7Lcqm
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Sat, Jan 10, 2004 at 02:10:36PM -0800, Gary Kline wrote:
>=20
> 	Folks,
>=20
> 	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:
>=20
> 	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.
>=20
> 	Is there a perl way to get rid of the
> 	string_containing_underscores and leave the regular sntences??
>=20

    perl -pi.bak -e 's/\s+\w+_\w+\.?//;' filename

	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

--uAKRQypu60I7Lcqm
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (FreeBSD)

iD8DBQFAAH2kdtESqEQa7a0RAu2aAKCDEjaos2oLvq4ZJraY4MAHwbdw7wCfUNf7
TH6FwX4KoYPqkERIcxSqK8c=
=QYM6
-----END PGP SIGNATURE-----

--uAKRQypu60I7Lcqm--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20040110223308.GA4881>