string line_read[18][2]; //assign array of string that will store 10 columns 100 rows of csv dataint rows=0,col=0; //column and row pointer for the array
handle=FileOpen("Dataset.csv",FILE_CSV|FILE_READ,","); //comma delimiterif(handle>0)
{
while(True) //loop through each cell
{
string temp = FileReadString(handle); //read csv cellif(FileIsEnding(handle)) break; //FileIsEnding = End of File
line_read[col][rows]=temp; //save reading result to arrayif(FileIsLineEnding(handle)) //FileIsLineEnding = End of Line
{
col = 0; //reset col = 0 for the next row
rows++; //next row
}
else
{
col++; //next col of the same row
}
}
FileClose(handle);
}
else
{
Comment("File "+filename+" not found, the last error is ", GetLastError());
}
Alert(line_read[15][1]);
Value = StrToInteger(line_read[15][1]);
Alert("IntVal:",Value);
@WilliamRoeder I attached the csv file earlier, it is just how it is shown on the Dataset.csv file with commas.
I have changed the Predicted value to FileReadInteger but stilt no avail.
They were missing initially, now I've populated it with values of 0 but the output is the same as I mentioned above.
I am going to attach a longer version of the dataset here. The actual file is 49 MB.
I don't know what I'm doing wrong, why is it so difficult to read a csv row and column value?
I will be extremely grateful for any help. Thank you.
Nevermind, I solved it with