- www.mql5.com
Hello there are 244 pages on csv here: https://www.mql5.com/en/search#!keyword=csv&module=mql5_module_forum
Thank you for your references. But it could have been more helpful if you have come up with something that will help. I have read many articles here but none was helpful to me. Hence, I have asked the question here. Please help me.
I do not know the answer directly maybe you have to specify the delimiter see: https://www.mql5.com/en/docs/files/fileopen
It seems to be a space in stead of the regular comma as in csv comma separated values.
You want to use commas separated values without using a comma to separate them.
You could try to specify the delimiter as being a space.
int FileOpen( string file_name, // File name int open_flags, // Combination of flags short delimiter='\t', // Delimiter uint codepage=CP_ACP // Code page );
- www.mql5.com
Kindly, let me know how is it possible to read the csv file's last line.
Форум по трейдингу, автоматическим торговым системам и тестированию торговых стратегий
Особенности языка mql5, тонкости и приёмы работы
fxsaber, 2018.04.06 17:08
// Заполнение массива строками из файла - альтернатива int FileToStrings2( const string FileName, string &Str[] ) { uchar Bytes[]; return(FileLoad(FileName, Bytes) ? StringSplit(CharArrayToString(Bytes), '\n', Str) : 0); }
void OnStart() { string Str[]; int Amount = FileToStrings2("Test.csv", Str); if (Amount) Print(Str[Amount - 1]); }
I do not know the answer directly maybe you have to specify the delimiter see: https://www.mql5.com/en/docs/files/fileopen
It seems to be a space in stead of the regular comma as in csv comma separated values.
You want to use commas separated values without using a comma to separate them.
You could try to specify the delimiter as being a space.
I tried it sir. But didn't worked for me.
Show the code.
The chance is extremely slim that the answer is not in one of these 244 search result pages.
I used to be able to solve 90% of the issues by just doing some searches.
You can also scoop over one of the quality articles for example this: https://www.mql5.com/en/articles/2720
Scroll down to the part:
Reading a text file with separators
- www.mql5.com
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
I am trying to read the last line time value from a csv file. Check the following:
The above is sample data. I have tried the following code and the result is as follows:
Output:
I m not getting the complete date value. Even if I try to increase the offset of the FileSeek()function.
Kindly, let me know how is it possible to read the csv file's last line.