int nLines = 0, handle = FileOpen(nameOPT, FILE_CSV|FILE_READ, '~'); if(handle < 1) ... while(true){ string line = FileReadString(handle); if( line == "") break; // EOF nLines++; } FileClose(handle); Print("File contains "+nLines+" lines");See also get list of all symbols running in mt4 programatically - MQL4 forum
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Good Day...
Is there a way on how to count how many lines are there in a text file?
for example the text file contains...
EURUSD
GBPUSD
EURJPY
USDCHF
after reading the text file using FileOpen it should return 4 as it contains only 4 symbols or 4 lines...
Thank you very much...