Re: perl script question.

2004-01-26 Thread Gary Kline
On Sat, Jan 10, 2004 at 11:02:18PM +, Matthew Seaman wrote: On Sat, Jan 10, 2004 at 11:39:07PM +0100, Björn Andersson wrote: On Sat, Jan 10, 2004 at 10:33:08PM +, Matthew Seaman wrote: On Sat, Jan 10, 2004 at 02:10:36PM -0800, Gary Kline wrote: Folks,

Re: perl script question.

2004-01-11 Thread Bernard El-Hagin
Matthew Seaman wrote: 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?rn Andersson wrote: If this occures more than once on a line we should have the line as this: perl -pi.bak

Re: perl script question.

2004-01-11 Thread Matthew Seaman
On Sat, Jan 10, 2004 at 05:34:34PM -0800, Gary Kline wrote: On Sat, Jan 10, 2004 at 11:02:18PM +, Matthew Seaman wrote: perl -pi.bak -e 's/\s*\w+_\w+\.?//g;' filename The lines do indeed wrap so this does the job on a test file. I do have the re-exp book but this one is

Re: perl script question.

2004-01-11 Thread Gary Kline
On Sun, Jan 11, 2004 at 11:52:37AM +, Matthew Seaman wrote: On Sat, Jan 10, 2004 at 05:34:34PM -0800, Gary Kline wrote: On Sat, Jan 10, 2004 at 11:02:18PM +, Matthew Seaman wrote: perl -pi.bak -e 's/\s*\w+_\w+\.?//g;' filename The lines do indeed wrap so this does the

perl script question.

2004-01-10 Thread Gary Kline
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

Re: perl script question.

2004-01-10 Thread Bernard El-Hagin
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,

Re: perl script question.

2004-01-10 Thread Matthew Seaman
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

Re: perl script question.

2004-01-10 Thread Björn Andersson
If this occures more than once on a line we should have the line as this: perl -pi.bak -e 's/\s+\w+_\w+\.?//g;' filename Notice the added g. :-) On Sat, Jan 10, 2004 at 10:33:08PM +, Matthew Seaman wrote: On Sat, Jan 10, 2004 at 02:10:36PM -0800, Gary Kline wrote: Folks,

Re: perl script question.

2004-01-10 Thread Matthew Seaman
On Sat, Jan 10, 2004 at 11:39:07PM +0100, Björn Andersson wrote: On Sat, Jan 10, 2004 at 10:33:08PM +, Matthew Seaman wrote: 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

Re: perl script question.

2004-01-10 Thread Marty Landman
At 06:02 PM 1/10/2004, Matthew Seaman wrote: On Sat, Jan 10, 2004 at 11:39:07PM +0100, Björn Andersson wrote: If this occures more than once on a line we should have the line as this: perl -pi.bak -e 's/\s+\w+_\w+\.?//g;' filename Good point. Also, if the stuff_separated_by_underscores wraps

Re: perl script question.

2004-01-10 Thread Matthew Seaman
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örn Andersson wrote: If this occures more than once on a line we should have the line as this: perl -pi.bak -e 's/\s+\w+_\w+\.?//g;'

Re: perl script question.

2004-01-10 Thread Marty Landman
At 06:36 PM 1/10/2004, Matthew Seaman wrote: Err --- Gary Kline was the OP asking how to do this: I think you mean Bernard El-Hagin's solution? % perl -i.bak -pe 'tr/_/ /' files That doesn't do the right thing. Woops, not only can't I read the question right, can't read the poster's name

Re: perl script question.

2004-01-10 Thread Gary Kline
On Sat, Jan 10, 2004 at 11:36:45PM +, Matthew Seaman wrote: 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örn Andersson wrote: If this occures more than once on a line we should