use strict; use warnings; my $last_line=''; open (DIFFR, "/tmp/log.diff") or die "Can't open /tmp/log.diff: $!"; while (<DIFFR>) { chomp; if (/\bERROR\b/) { print CSVFILE $last_line; print CSVFILE "$line,"; } $last_line = $_; }
In reply to Re: need to extract top and bottom lines...
by Eimi Metamorphoumai
in thread need to extract top and bottom lines...
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |