Possible solutions:
Command line:
perl -ne 'BEGIN { our $offset=-1 } $offset=2 if /^LUN 40\s*$/; print i +f !$offset--;' 743702.dat
Script:
But doesn't work if LUN 40 re-triggers (e.g. two consecutive LUN 40 lines). That might need a list to match against (e.g. using grep).use strict; my $trigger = -1; while (<>) { $trigger = $. + 2 if /^LUN 40\s*$/; print if $. == $trigger; }
In reply to Re: trying to do a parse based on starting position.
by Perlbotics
in thread trying to do a parse based on starting position.
by luckenbach
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |