Can't be done.
It does not have n × m values. It has formulas, formatting, macros, values, versioning and who know what else. You can't read the propriety binary format.
Save as a CSV, and then you can read that.
Can't be done.
It does not have n × m values. It has formulas, formatting, macros, values, versioning and who know what else. You can't read the propriety binary format.
Save as a CSV, and then you can read that.
Hi William Roeder, Sorry, my bad wrote excel file in typing flow.
Its an .csv file actually. Just getting this strange value at the start of the file while reading in mt4. Please refer to the screenshot attached as file.
Code for reading is as following:
extern string fileName = "Alert1.csv"; //File Name int modeRead = FILE_READ|FILE_CSV; //File Opening Mode string delimeter = ";"; //Parameter of Sepration in File //Message Array string msg[n] = {NULL}; void ReadData() { int filehandle = FileOpen(fileName, modeRead, delimeter); if(filehandle!=INVALID_HANDLE) { while(!FileIsEnding(filehandle)) { msg[i] = FileReadString(filehandle); //printf(msg[i]); SplitString(msg[i]); i++; } FileClose(filehandle); } else Print("Error Opening File.", GetLastError()); }
Code for reading is as following:
what application did you use to create the csv file?
it could be that it is a proprietary format.
- Paul Anscombe: what application did you use to create the csv file?
It also could be Unicode or ANSI; specify in the mode.
- Tamur Taj: Code for reading is as following:
SplitString(msg[i]);
Don't post code that will not compile. StringSplit - String Functions - MQL4 Reference
what application did you use to create the csv file?
it could be that it is a proprietary format.
I'm just reading prices and datetime data to make an price and time alert EA.
-
It also could be Unicode or ANSI; specify in the mode.
-
Don't post code that will not compile. StringSplit - String Functions - MQL4 Reference
Okay, I'll try Both to check if it solves the problem or not. Regarding point 2 thanks for the tip.
Solution to this issue was just to save file as .csv (Comma delimited) file only. Don't use any other formats of csv as excel provides almost 3 of them.
The symbol in the attached screen shot was a BOM i.e. Byte order mark, and it caused by other formats of csv.
So, in order to get rid of it just save the file in simple csv format.
-
Don't Hijack other threads for your off-topic post. Next time, make your own, new, thread.
-
Do you really expect an answer? There are no mind readers here and our crystal balls are cracked. Always post all relevant code (using Code button) or attach the file.
How To Ask Questions The Smart Way. (2004)
Be precise and informative about your problemWe can't see your broken 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
Hi everyone.
I need a little help with this issue I'm facing. I'm reading an .csv file in mt4 using mql4. The file has 2 columns and 20 rows.
I'm able to read the data from the file but when I read data, in the first cell I get some unknown symbols with my data that is causing problem with my further calculation. Can anyone please tell me what it is.
My file read mode is: FILE_READ|FILE_CSV.
I'm attaching the screen shot of the data I only get for the 1st cell in 1st row only. It will be very kind of you if you let me know what it is and how to get rid of it Or anyway around.