again read File where mistake ?

 

hi guys  i read this part

https://docs.mql4.com/files

and i try to read  a file  i use this code  for do that  but  nothing  i tryed  in all mode possible i think, but  probably  escape somthing

i try also insert relative path directly but noting , how is possible ?


 string nameFile="forexsymbol.csv";
   string terminal_data_path=(TERMINAL_DATA_PATH);
// string terminal_data_path=TerminalInfoString(TERMINAL_COMMONDATA_PATH);
   Print("IL PATH E' "+terminal_data_path+"\\MQL4\\Files\\forexsymbol.csv");
//string filename="\\dataCOT\\Finance\\forexsymbol.csv";  //
   //string filename=terminal_data_path+"\\MQL4\\Files\\"+nameFile;  //
    string filename="C:\\Users\\pc\\AppData\\Roaming\\MetaQuotes\\Terminal\\1DAFD9A7C67DC84FE37EAA1FC1E5CF75\\MQL4\\Files\\forexsymbol.csv";  //
Print("deMDEMDEMDEM "+ filename);

   string line_read[2][416]; //assign array of string that will store 2 columns 416 rows of csv data
   int row=0,col=0; //column and row pointer for the array
   int  handle=FileOpen(filename,FILE_CSV|FILE_READ,";"); //comma delimiter

   if(handle>0)
     {
      while(True) //loop through each cell
        {
         string temp = FileReadString(handle); //read csv cell
         if(FileIsEnding(handle))
            break; //FileIsEnding = End of File
         line_read[col][row]=temp; //save reading result to array
         if(FileIsLineEnding(handle)) //FileIsLineEnding = End of Line
           {
            col = 0; //reset col = 0 for the next row
            row++; //next row
           }
         else
           {
            col++; //next col of the same row
           }
        }
      FileClose(handle);
     }
   else
     {
      Comment("File "+filename+" not found, the last error is ", GetLastError());
     }


   Print("I CHE CE DENTRO "+line_read[1][1]);


   return 0 ;
  }
File Functions - MQL4 Reference
File Functions - MQL4 Reference
  • docs.mql4.com
For security reasons, work with files is strictly controlled in the MQL4 language. Files with which file operations are conducted using MQL4 means cannot be outside the file sandbox. the common folder for all the terminals installed on a computer - usually located in the directory C:\Documents and Settings\All Users\Application...
 
"C:\\Users\\pc\\AppData\\Roaming\\MetaQuotes\\Terminal\\1DAFD9A7C67DC84FE37EAA1FC1E5CF75\\MQL4\\Files\\forexsymbol.csv"

You are trying to read "C:\Users\pc\AppData\Roaming\MetaQuotes\Terminal\1DAFD9A7C67DC84FE37EAA1FC1E5CF75\MQL4\Files\C:\Users\pc\AppData\Roaming\MetaQuotes\Terminal\1DAFD9A7C67DC84FE37EAA1FC1E5CF75\MQL4\Files\forexsymbol.csv" That path does not exist.

Perhaps you should read the manual.
    How To Ask Questions The Smart Way. 2004
      How To Interpret Answers.
          RTFM and STFW: How To Tell You've Seriously Screwed Up.

You read files out of "…\files" Just open "forexsymbol.csv".

 

why  you tell this  ?

the  string  is 

filename="C:\\Users\\pc\\AppData\\Roaming\\MetaQuotes\\Terminal\\1DAFD9A7C67DC84FE37EAA1FC1E5CF75\\MQL4\\Files\\forexsymbol.csv";
int  handle=FileOpen(filename,FILE_CSV|FILE_READ,";"); //comma delimiter

where is  the  first equal path ?

 

finally i understund  sorry

i resolve with this


  string filename="forexsymbol.csv";  //