I have a data, which is seperated by "," and I have 7 lines of that. I am trying to read the data seperated by comma into 2d vector like this:
ifstream input;
input.open("wordplate.csv");
vector<vector<string>> data;
string line;
while(getline(input,line)){
cout<<"A\n";
stringstream ss(line);
string value;
vector<string> record;
while(getline(ss,value,',')){
record.push_back(value);
}
data.push_back(record);
}
input.close();
But for some reason, I am getting only the last line of my csv file. What am I doing wrong here?