populate array from csv

 
  int h = FileOpen(FileName, FILE_CSV|FILE_READ,',');
    for (int c=0; !FileIsEnding(h) && c<9999; c++)  {
        if (FileIsEnding(h)) break;
         ask[c]=
         bid[c]=...  
       
    }
  FileClose(h);

Hi all,

Assuming I have a CSV file with 2 colums (one with Ask and one with Bid price) for let's say 100 rows.
Now i would like to fill my arrays with the data from the CSV file. I 've found the above loop but what I don't get is
how the correct row from teh CSV file is taken if for example I use array1[c]= StrToDouble(FileReadString(h));.
The c counter shifts the array index but there's no counter or shift for the position (row) in the CSV file. Could anyone please point me in the right direction as to how I can make sure that each index of the array is filled with the corresponding row from the CSV file? For example CSV file: 2 columns, 101 rows, ask[100], bid[100]. So array ask index 0 should be filled with column 1 and row101, index 1 row 100 etc.

thanks!

 
There are some good examples here: https://book.mql4.com/functions/files