Read double values from csv file

 

Hello everybody,

I have a problem about reading some double values from a csv file.

This is the content of my csv file I'm using as example:


3;0;0.01;6;11.91346

63;1;0.02;5;2.786357


and this is my algorithm:


void OnStart()

  {

   filehandle = FileOpen("WTI.csv",FILE_READ|FILE_CSV,';',CP_ACP);


   if(filehandle != INVALID_HANDLE)

   {

      Print("File correctly read");


        while(FileIsEnding(filehandle)==false)

        {       

           while(FileIsLineEnding(filehandle)==false)

           {

              TempHistArray[c] = FileReadNumber(filehandle); 

               c++;

           }

       }

      FileClose(filehandle);

    }

   

       else

       {

        PrintFormat("Failed to open file");

       }

}


I can correctly open the file but when I use Print functions to display the values I've just read, it shows only 0.0 values: every value is null!

I've followed the instructions I've found on this forum about csv reading, but I cannot achieve this operation.

Might somebody help me?

Thanks very much!

Reason: