is it possible to open a full csv file without stopping in /n or using loop?

 
I was looking to import historical data to several custom symbol as quickly as possible and thought about it:

0. Open the file
1. Read the entire csv file
2. Convert entire file to rows
3. Convert all rows into cells
4. Convert all cells to time, open, high, low, close, volume
5. Import all data to the custom symbol (CustomRatesReplace)

More so far I have not found a way to completely read the csv file

I know bin file for default is read completely if you do not use a delimiter, csv and txt stop /n

I know I can use a loop, but my thoughts say it will be slower


int openFile = FileOpen(symbol, FILE_READ|FILE_CSV|FILE_ANSI); // open file
   string readFile = FileReadString(openFile,(int)FileSize(openFile)); // read file
   Print(readFile);


 
Fabio:
I was looking to import historical data to several custom symbol as quickly as possible and thought about it:

0. Open the file
1. Read the entire csv file
2. Convert entire file to rows
3. Convert all rows into cells
4. Convert all cells to time, open, high, low, close, volume
5. Import all data to the custom symbol (CustomRatesReplace)

More so far I have not found a way to completely read the csv file

I know bin file for default is read completely if you do not use a delimiter, csv and txt stop /n

I know I can use a loop, but my thoughts say it will be slower



Hi Fabio, in attach an example to read all csv file

genio

Files:
Test.ex4  8 kb
Test.mq4  4 kb
 
Eugenio Bravetti:

Hi Fabio, in attach an example to read all csv file

genio

Hi, thanks for the reply

I looked at your code and in that case it is reading line by line and not the whole file.

In this case, it is generating a print of the whole file and not reading the whole file at one time.

The purpose is to read the whole file to transfer to memory,

because reading row by row or vrigula by comma and at the same time dialing in an array gets grimly slow


The most I got was, but obviously does not work:

   for(int i = 0; i < limit; i++) {
      string readFile = FileReadString(openFile);
      allFile += readFile + ",";
      Print(allFile);
   }

From here, separate by the comma, mark in the array cells[] then mark in the array mqlrates rates[]

 
I was looking at FileLoad plus it looks like it read .bin files