Brian Funk wrote:
I need a starting point to learn to accomplish the following action:

I need to take a plain text ascii file such as:

Foo
a line of variable text
another line of variable text
morelines
and
morelines
Foo
a line of variable text
another line of variable text
morelines
and
morelines
Foo
a line of variable text
another line of variable text
morelines
and
morelines

and I need to end up with:

Foo
morelines
and
morelines
Foo
morelines
and
morelines
Foo
morelines
and
morelines

In short, I want to see "Foo" in the file and delete the next two lines following. This pattern can repeat hundreds of times within the file and spread across multiple files.

I'd rather learn to write something in preference to using a canned module.

while ( <FH> ) {
    if ( /^Foo/ ) {
        <FH>;
        <FH>;
        }
    print;
    }



John
--
Perl isn't a toolbox, but a small machine shop where you
can special-order certain sorts of tools at low cost and
in short order.                            -- Larry Wall

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/


Reply via email to