in reply to Re^2: need to extract top and bottom lines...
in thread need to extract top and bottom lines...
perl -ne 'sub BEGIN {$l="";}$l=$_, next unless /ERROR/;print /^[^12]/ +? "$l$_" : $_;$l=$_;' some.log
Not Y3K compliant.
JohnGG
Note: something is eating the square brackets around the character class ^12 for some reason. Code tags don't help.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: need to extract top and bottom lines...
by johngg (Canon) on Dec 16, 2004 at 11:20 UTC |