in reply to Re: Re: Finding and extracting lines of text
in thread Finding and extracting lines of text
so just throw away the first two lines. Here's a quick fix on ajdelore's code
$success = 0; open(FILE,"dumptape.log") or die ("Could not open file"); while(<FILE>) { if (/Dump phase number 3/) { print; <FILE> for (1..2); print <FILE>; $success = 1; last; } } if(!$success) { print "Failed dump log\n"; #do other failed dump log stuff here } close FILE;
It seems like you have an understanding of some areas of perl, but are lacking some of the basics. You should look for an online tutorial (or better, one of the O'Reilly books), to pick up on a few of the little things you're missing.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Re3: Finding and extracting lines of text
by mikevanhoff (Acolyte) on Jul 30, 2003 at 21:09 UTC |
In Section
Seekers of Perl Wisdom