perl script question.

Matthew Seaman m.seaman at infracaninophile.co.uk
Sat Jan 10 14:33:20 PST 2004


On Sat, Jan 10, 2004 at 02:10:36PM -0800, 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??
> 

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

	Cheers,

	Matthew	

-- 
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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 187 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-questions/attachments/20040110/7222665a/attachment.bin


More information about the freebsd-questions mailing list