I'm reading into a 2d vector from a CSV file. However, when it reads this cell, it assumes it is the end of the line and thus makes that particular vector have only a size of 1.
"HAM/ G60-II (1111-66F)
SION-01",
This is what it looks like when opening the CSV file in notepad. When I copied it here, it automatically put a newline character it looks like, but it doesn't look like that in notepad. Here's a snip of what it looks like in notepad.
Also, it's weird because when I look at that cell in Excel, the "SION-01" is nowhere to be found, no matter how far I expand the column. However, when I control+f the document for it, it points right to that cell...it's weird. It looks like there's a newline character in the actual value which is causing the problem. I have one idea but I have no idea how to implement it. It would be to read the values between the commas, but then I wouldn't know when the line actually ends. I really don't know how to proceed with this. Most of the excel files that I read with my program have values separated by quotes but some don't.
ifstream file(filename);
while (file)
{
string line;
if (!getline(file, line)) break;
istringstream ss(line);
vector<string> words;
while (ss)
{
string s;
if (!getline(ss, s, ','))break;
words.push_back(s);
}
list.push_back(words);