Really? For a while, the only way I knew of was to read in chunks.
I've only learned to get EVERYTHING from a file.
Anyway, a quick search in Google for c++ io, second result: a tutorial on Input/Output with files. It would be good if you read it...
Using ifstreams and ofstreams is a lot like cin and cout. If your data just has a single word on each line, you could just do something like:
until you got to the value you wanted, store that value, and then keep going until you find the next value you want. If there are more than one words per line use
in/*your ifstream*/ >> myStr/*your string*/;
and do the same thing, keeping only the values you want. So basically all you're doing is inputting each line, if it's what you want, keep it. Otherwise, just throw it out (figuratively speaking).
getline(in, myStr) // This is all assuming you're using std::strings, which you should