I'm trying to correctly parse the file object RecordFile using commas instead of spaces and then assign the data to the correct variables. I am currently parsing using spaces as seen in the record sample below. Any suggestions?
ifstream RecordFile("records.txt");
while (!RecordFile.eof())
{
string f, l, aba, id, e;
RecordFile >> f >> l >> aba >> id >> e;
Recordsarray[i].setRecords(f, l, aba, id, e);
i++;
recordcounter++;
}
RecordFile.close();
return recordcounter;
Example Record:
Albert Green 000000000 8181234567 a.green@piercecollege.edu