I'm trying to write a program that will import data from a text file, pass that data into a set of functions that I have created, and export the processed data into a new text file. The data that I have is in the following format, and repeats around 15000 times:
Run 141544 event 7
m1: pt,eta,phi,m= 281.327 -0.489914 1.12498 0.1 dptinv: 0.000406393
m2: pt,eta,phi,m= 238.38 0.128715 -2.07527 0.1 dptinv: 0.000399279
Each entry consists of four lines, followed by a blank line that separates it from the following entry. The data that I need to import is the entire first line of each entry, and the values on the 3rd and 4th lines (not including the dptinv value), which are delimited by spaces. I would like to store the values for each event in an array, so they could be input into functions. Would using a counter variable be the best way to do this? If so, how would it be implemented?