Quote:
Originally Posted by samanp
<time stamp> <file name>
<time stamp> <result>
|
Assuming they're on consecutive lines, then
Code:
awk '(NF==2 && $2!=0 && $2~/^-*[1-9][0-9]*$/) { print last ; print $0 ; next } { last=$0 }' file
should do the trick. It keeps the previous line in
last, printing it and the current line if the second field in the current line is numeric and nonzero. You can modify the
last=$0 and
print last ; print $0 statements to define which bits are output.
Hope this helps.