in reply to
Re: Search file for certain lines
in thread Search file for certain lines
ahhh... So there are not h-starts and h-stops. h(lower case) simply indicates the beginning of a record. My approach would be to find h line and use is as the key in a hash, then iterate until finding each of the subsequent j,E,G lines and adding them as an array under the key(HoA). When you find another h-line, you make a new key and wash,rinse,repeat until end of data. You end up with a structure which is pretty easy to continue to manipulate and do further clean up on if you want to.
I am sure there are a bunch of other ways to do this, many better. But what I like about this approach is that it uses well documented data structures which are simple to manipulate. Good luck! Should be fun... :-)
- ...the majority is always wrong, and always the last to know about it...
- The Spice must flow...
- ..by my will, and by will alone.. I set my mind in motion