Find specific datas

Hello, i'm working on a program for my thesis, this program is supposed to go trhough a bunch of file and retrieve two sets of numbers each time it finds these two words: Isp and Ivac.
the outlook of the files which contain the datas is like this
.
.(a bunch of other stuff)
.
Isp, M/SEC 34390 234356
Ivac, M/SEC 34532 284654
,
,
,
Isp, M/SEC 34343 234246
Ivac, M/SEC 32432 284574

I'm having problem with the searching for the lines and then retrivial of the datas. What I wrote is this
1
2
3
4
5
6
7
8
9
while(! fin.eof())
    {       getline (fin,what);
            if (what.find("Isp,") || what.find("Ivac,"))
            {ofstream out("isp_ivac.txt", ios::app);
            cerr<<what<<endl;
            out<<what<<endl;
            }
            
    }

the problem is that instead of saving/printing me just the single line it saves/prints me the whole file.Besides even if I were able to retrieve the single line i'm interested I wouldn't know hot to "tell" to skip the words and get only the numbers. I appreciate you help
Haven't we seen this exact same question before?
yes
string::find() does not return a boolean value.
Topic archived. No new replies allowed.