With MQL for text files simplest thing is to read line by line from the field and then search inside the line with StringFind() function.
Ctrl + F
Ctrl + F
i was programatic search
Please show your attempt.
int fhandle=FileOpen("blg.txt",FILE_READ|FILE_BIN); string want,str2; string str; str= FileReadString(fhandle,100000); want="MESSAGE"; k=StringFind(str,want,2); c=FileTell(1); g=c-k-7; FileSeek(fhandle,-g,SEEK_CUR); str= FileReadString(fhandle,250); c=FileTell(1); //Alert("cp",c); FileSeek(fhandle,-187,SEEK_CUR); str2= FileReadString(fhandle,200); b=StringFind(str,"<div",2); str=StringSubstr(str,0,b);
Ok. You read the data in a buffer (string) and use StringFind(), seems correct approach.
And what is the problem ?
Ok. You read the data in a buffer (string) and use StringFind(), seems correct approach.
And what is the problem ?
i download a blogsites home page. my need is to extract the last post. each post will have the starting word MESSAGE and then some txt.
But when i use that it was extracting text from the first line of the file.
i have one doubt . What is the maximum buffer size ? how much characters it can hold ?
the file size was some what 80 KB.
Whether that may be an issue ?
Meanwhile i have found some other way to do it.
but still i want to know, what went wrong in the previous code

- 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 want to search the text "MESSAGE" in a particular txt file in files folder.