in reply to trying to do a parse based on starting position.
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; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: trying to do a parse based on starting position.
by ikegami (Patriarch) on Feb 13, 2009 at 22:30 UTC | |
|
Re^2: trying to do a parse based on starting position.
by Bloodnok (Vicar) on Feb 14, 2009 at 10:59 UTC |