I have to process large files containing "logical" blocks of strings, each
block varying in number of lines.
....
Block number x
string1
string2
....
string n
Block number y
et cetera.
Blocks are read and processed one by one. My GetNextBlock ($index) function
returns an array with all lines in a block, and returns the line number of
the next block header.
What is the fastest way to skip those first <$index -1> lines the next read
? I cannot guarantee (unfortunately) the file is still open, so the file
pointer must be assumed at start of file again.
I had an intermittent solution in which I first split all the blocks into
separate files, but that caused a lot of other unwanted effects beyond the
scope of this posting.
Hints, pointers appreciated!
TIA
Pjotr