Suppose I want to find something, that is present multiple times in a large (several hundred megabyte) file. However, I only want it if something else exists after it but before the next occurrence of the thing I am looking for.
For instance the thing I am looking for might be a set of code numbers and the condition that I will use to decide whether I want the code may be 1 or more lines further into the file but before the next occurrence of a code number.
What is the best (most elegant) way to approach this problem?
Chet