in reply to Finding and extracting lines of text
This will print out the matched line, and then the three lines following it. This, if I understand correctly, is what you are trying to do.
open(FILE,"dumptape.log") or die ("Could not open file"); while(<FILE>) { if (/Dump phase number 3/) { print; print <FILE> for (1..3); last; } } close FILE;
</ajdelore>
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Re: Finding and extracting lines of text
by mikevanhoff (Acolyte) on Jul 30, 2003 at 12:52 UTC | |
by swkronenfeld (Hermit) on Jul 30, 2003 at 16:58 UTC | |
by mikevanhoff (Acolyte) on Jul 30, 2003 at 21:09 UTC |