I am trying to write a program that will open a specific file and go through it, writing the data I need to another file. Everytime the tag 'Step 4' comes up I need to get the next two numbers and write them to a seperate file. (the purpose is to get the data to create a load displacement curve for an atomic simulation we're running) The results file is periodic, meaning that it repeats itself many times so the inefficient way would be to figure out how many lines are repeated and ignore that many before getting the data. The problem is, each simulation will have a different amount of lines needing to be skipped so it would take a lot of work to change the code for each different simulation. I'm hoping to write a more general code that can be used for all the simulations.
So here is my question: is there any way to ignore to a specific sequence of characters? (ie: ignore until it hits 'Step 4')
I tried "inStream.ignore(4000, 'Step 4');" but it give me errors because 'Step 4' is more than one character. Is it possible to ignore until a specific sequence of characters instead of to a single character? Any help is GREATLY appreciated!!