in reply to need to extract top and bottom lines...
There might be an easier way but you could do this:
open (DIFFR, "/tmp/log.diff"); while (<DIFFR>) { $line=$_; chomp($line); if ($line =~ /ERROR/) { print CSVFILE "$oldline\n"; #look below if stat. print CSVFILE "$line,"; } $oldline = $line; #sets a variable with the last line }
"Cogito cogito ergo cogito sum - I think that I think, therefore I think that I am." Ambrose Bierce
|
|---|