Hello nicholasjb1996,
I Think there may be some misunderstanding here. If what you show in the code tags is the file you are calling a CSV file then it is not. If you have a different file that you are using then post a sample of it.
You say:
So far I have managed to read in the data and store it in a .txt file for later use |
Why do you need to do this?
You should be reading the CSV file and storing the fields in variables or a struct. I would lean towards the struct and store it in a vector or array for later use.
Without seeing the proper CSV file and what code you have written it is mostly a guess.
You can use "std::getline" something like:
std::getline(inFile, part, ',');
. If what you read happens to be a numerical value then you would need to follow the "getline" with
numericalVariable = std::stoi(part);
This is for an "int" use "std::stod" for a double.
I am not sure if you are aware that Excel can save a file as a CSV file to start with. Then all you have to do is read the file.
Sorry if I seem to be rambling, but I am not quit sure exactly what you have done and are trying to do.
I have an Excel spread sheet that saves it-self as a CSV file and a C++ program that transforms the data into a ".html" file that I use about every other day. So what you need to do would not be that difficult.
Hope that helps. If there is anything else I can do let me know.
Andy