Hi all,
I'm trying to read in an excel file with data size 20x2. However, when i read in the file it reads every line in the workbook. Is there a way to only read entered data? Here is the code so far. Thank in advance for the help.
#include <iostream>
#include <fstream>
using namespace std;
int main()
{
int dataCount;
int size = 0;
int size1 = 0;
int size2 = 0;
int dataArray1[] = { 0 };
int dataArray2[] = { 0 };
OK so I looked around and altered my code a little. Basically what I'm trying to do is read in data sets, save the data in an array, and then print out the array. I also want to use the numbers in the array so I need them as int or double. So I have tried saving it as .cvs and .txt and then trying to read it, but when I cout I get the entire line with the commas. Here is what I have so far. Thanks for the feedback so far guys.
Well I think I figured it out, so I wanted to post it in case anyone else has the same problem. I don't think .xlsx works at all if you don't have advanced knowledge. I used .txt and .csv per recommendations by the guys above and it worked. I used stringstream to convert the strings to integers to save them in the array. So here it is and any comments on how to make it prettier are welcome!
xlsx file is not a text file, it is a binary file, so you cannot easily read strings from it.
You have to know the file format.
Actually, it is a zip file which contains a few xml files.