#include <stdio.h>
#include <stdlib.h>
#include <iostream>
#include <fstream>
#include <vector>
#include <sstream>
using namespace std;
int main()
{
    string line;
    ifstream infile ("Input.csv");
    vector<string> table;
    string word;
    if(infile.is_open())
    {
        getline(infile,line);
        istringstream iss(line);
        while(!iss.eof())
        {
            getline(iss,word, ',');
            table.push_back(word);
        }
    }
    for(int index=0; index<11; ++index)
    {
        cout<< "Element" << index << ":" << table.at(index) << endl ;
    }
    infile.close();
}
In the above program I am reading values from input file and splitting based on comma and finally storing the values into a vector.
when I print vector I am able to view only the first line of input file.
Input file:
     CountryCode,Country,ItemCode,Item,ElementGroup,ElementCode,Element,Year,Unit,Value,Flag
     100,India,3010,Population - Est. & Proj.,511,511,Total Population - Both sexes,1961,1000,456950,
     100,India,3010,Population - Est. & Proj.,511,511,Total Population - Both sexes,1962,1000,466337,
     100,India,3010,Population - Est. & Proj.,511,511,Total Population - Both sexes,1963,1000,476025,
     100,India,3010,Population - Est. & Proj.,511,511,Total Population - Both sexes,1964,1000,486039,
Output:
  Element0:CountryCode
  Element1:Country
  Element2:ItemCode
  Element3:Item
  Element4:ElementGroup
  Element5:ElementCode
  Element6:Element
  Element7:Year
  Element8:Unit
  Element9:Value
  Element10:Flag
Problem: Only 1st line is being printed
 
     
     
     
     
     
    