I mainly use the following code. This code goes line by line and captures different fields of the shared comma-separated table file. My problem is that sometimes the "title" field can contain commas. When this happens, it is surrounded by quotation marks: "This is my title." But when my code sees the comma, it just treats everything after it as the next field. Not all names have quotes around them, only those who have commas. My problem is that I have no idea how to do code verification for this .... How can I get my code to verify this problem?
Thanks a lot, yall. It means a lot to my paid work!
while (getline(BookLine, ImpLine, '\n')) // Get each line { // create a string stream from the standard string std::istringstream StrLine(ImpLine); std::string bookNumber, chk, author, title, edition; // Parse lines std::getline(StrLine,bookNumber,','); std::getline(StrLine,chk,','); std::getline(StrLine,author,','); std::getline(StrLine,title,','); std::getline(StrLine,edition,','); }
source share