I'm looking for a way to read only specific sets of data from a text file. Later I need to "feed" a class with it's content and store the objects in a vector.
My problem is, that I don't need the whole content of the lines and would like to discard or ignore what's coming next and jump to the next line of the text.
I would be very happy if you have a solution or tips for me :)
Each line in the file is structured like this:
brand modelName yearOfProduction price moreStuffIDontCareAbout
Here's what I've come up with so far.
while (inputFile >> brand >> modell >> yearofproduction >> prize) {
vecBikes.push_back(Bike(brand, modell, yearofproduction, prize));
getline(inputFile, puffer);
}