in reply to Reading a part of text file between markers
Well, judging by the code you've written so far . . . oh, nevermind.
Setup a variable to keep track of what state you're in. Read the file line by line. If it's a matching rule, set the state to 'looking for begin'. If you're looking for begin and see a begin, set the state to 'seen begin'. If you've seen a begin and it's an end line, set the state back to 'looking for rule'; otherwise process the line and stick whatever results wherever apropriate.
|
|---|