I have csv file input where I read in multiple lines which contain multiple fields related to that line. How do I write a loop which reads a line of text from the csv file, then keeps looping until it reaches the end of that line. This while loop would be nested in an !infile.eof while loop. Here is what I has so far but doesn't work exactly.
while (getline(infile, currentline))
{
getline(infile, ID, ',');
getline(infile, Name, ';');
Person p = new Person(ID, Name);
}
A line in the csv file looks like this: 111, james; 222, lynda; 333, luke;
Each line represents a classroom so there would be multiple lines.