The first entries of each line tell you what kind of particle you are dealing with and the next four entries are energy, x-position, y-position and z-position respectively. I process this data with the getline function:
1 2 3 4 5
ifstream myfile("C:\\file.txt");
while (myfile.good())
{
getline(myfile, line);
}
Next I need to extract the energy and x, y and z positions from each line so that that you would be able to write the parameters from each line like:
LB, would that not be just writing the information back into myfile? I want to extract these quantities so that I can then use them to perform other calculations.....