Table from CSV

Hello, its there any easy way how to get "table from CSV" to two dimensial array ?

Example: 
1997,Ford,E350,2.34
2000,Mercury,Cougar,2.38


to array on position
0,0 = 1997
0,1 = Ford
0,2 = E350
0,3 = 2.34
1,0 = 2000
1,1 = Mercury
ETC.
bump
using fstream/stringstream and getline, it would be relatively easy:
1
2
3
4
5
6
7
8
9
10
11
12
13
string a[...][...];
ifstream ifs(...);
...
string line;
for(int i = 0; getline(ifs, line); ++i)
{
  istringstream iss(line);
  string part;
  for(int j = 0; getline(iss, part, ','); ++j)
  {
    a[i][j] = part;
  }
}


See:
http://www.cplusplus.com/reference/fstream/ifstream/
http://www.cplusplus.com/reference/sstream/istringstream/
http://www.cplusplus.com/reference/string/string/getline/
Topic archived. No new replies allowed.