I would like to read a .csv file into a c++ code and then convert the text data into a structure .. i can write a algorithm to read the .csv file but how will i save it into a structure... .. The data in the csv file is in the excel cells the 1st Column contains latitude , 2nd column contains longitude and 3rd contains the branch code and 4th contains the address and there are 7000 rows containing different locations and addresses.. i need to save these into a structure in C++ algorithm
#include <iostream>
#include <fstream>
#include <string>
using namespace std;
int main () {
string line;
ofstream myfile;
myfile.open("burgerking.csv");
if(myfile.is_open()){
cout<<"The file is open"<<endl;
while (getline(myfile,line)) {
cout << line << '\n';
}
}
myfile.close();
system("PAUSE");
return 0;
}