Have a text file which looks like the following:
txt1 1001
txt1 1002
txt1 1003
txt1 1004
txt2 1005
txt2 1006
txt2 1007
txt2 1008
txt2 1009
txt3 1010
txt3 1011
txt3 1012
etc
Each block can have different number of lines
I want to be able to loop through each line of the file. On the first pass, I want to grab the first line from the first block, first line from the second block etc and use the number eg 1001, 1005, 1010 etc.
On the second pass, grab the second line from the first block, sesond line from the second block etc and use the number
I'm think you probably need to tag the ones that have been done
*txt1 1001
.
.
*txt2 1005
The goal is the grab a number(which is unique) as long as it is from a separate block until eof. Any ideas?
The text file does not have to have the formatting above - can have gaps or no gaps between blocks
Your help would be greatly appreciated
txt1 1001
txt1 1002
txt1 1003
txt1 1004
txt2 1005
txt2 1006
txt2 1007
txt2 1008
txt2 1009
txt3 1010
txt3 1011
txt3 1012
etc
Each block can have different number of lines
I want to be able to loop through each line of the file. On the first pass, I want to grab the first line from the first block, first line from the second block etc and use the number eg 1001, 1005, 1010 etc.
On the second pass, grab the second line from the first block, sesond line from the second block etc and use the number
I'm think you probably need to tag the ones that have been done
*txt1 1001
.
.
*txt2 1005
The goal is the grab a number(which is unique) as long as it is from a separate block until eof. Any ideas?
The text file does not have to have the formatting above - can have gaps or no gaps between blocks
Your help would be greatly appreciated