skipping to an unknown position in a file

Howdy, all.

I have a basic I/O question. I need to grab data for later processing from a known file. What's not known is the starting and ending positions of the data (or the length of data).

The file to be read is of the form:

line 1
...
line whoknows
ALPHA <----string to match to start data grab
data_x1 data_y1
...
data_xn data_yn
OMEGA <-----string to match to terminate data grab

How do I do this? the examples here show how this is done with the generic starting points of beginning of file and end of file like the following.

is.seekg (0,ios::end);
length = is.tellg();
is.seekg (0,ios::beg);

but, how do i set the seeking to look for strings or characters?


Thank you in advance!

capt
- Get Input

- While Input != "ALPHA": Get More Data From File.

- If Input == "ALPHA": Break Loop, Process Data.
Topic archived. No new replies allowed.