in reply to Can I regex & grep to select contiguous lines?
As your lines are in chronological order anyway, it doesn't make sense to use grep. A grep will search through the whole array but you want a set of contiguous entries and as soon as you find one outside of the right interval you know you are done searching.
You would be better off simply iterating through the lines. If seconds don't matter at all, you can just look at the last digit of your minutes and once that digit mod 5 is the same as your starting digit, you are done.
If seconds do matter, you'll have to do a little more work but the principle of iterating though the lines instead of grepping still holds.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Answer: Can I regex & grep to select contiguous lines?
by blakem (Monsignor) on Aug 24, 2002 at 21:13 UTC |