Reading ASCII Files

 

Hi,

whith MATLAB I wrote an ASCCI File with several lines like:

2014/3/3/00:30  AUD  1 TD Wertpapiere Inflation (im Vergleich zum Vormonat) (FEB)
2014/3/3/00:30  AUD  1 TD Wertpapiere Inflation (im Vergleich zum Vorjahr) (FEB)
2014/3/3/00:50  JPY  2 Investitionsausgaben exkl. Software (4Q)
2014/3/3/00:50  JPY  2 Investitionsausgaben (4Q)
2014/3/3/00:50  JPY  1 Darlehen & Diskonte - Unternehmen (im Vergleich zum Vorjahr) (JAN)
2014/3/3/00:50  JPY  1 Company Profits (4Q)
2014/3/3/00:50  JPY  1 Company Sales (4Q)
2014/3/3/01:00  AUD  2 HIA Verkäufe von Neubauten (im Vergleich zum Vormonat) (JAN)
2014/3/3/01:01  GBP  1 Hometrack-Umfrage Wohnungsbau (im Vergleich zum Vormonat) (FEB)
2014/3/3/01:01  GBP  1 Hometrack-Umfrage Wohnungsbau (im Vergleich zum Vorjahr) (FEB)
2014/3/3/01:30  AUD  1 Vorräte (4Q)

I tried to read this with the following MT5 Code

   filehandle=FileOpen("Kohler_016.txt",FILE_READ|FILE_WRITE|FILE_TXT,"\r\n");
   Print("FileHande = ",filehandle);
   if(filehandle!=INVALID_HANDLE)
     {
      Print("So far all ok");
      meinstr=FileReadString(filehandle);
      Print("My Info = "+meinstr);

     }

   FileClose(filehandle);

Strange, no Error but also no information.

I hope that somebody has a hint for me.


Silas

 

Hello,

Please use the SRC button when you post code. Thank you.


This time, I edited it for you.

 
Silas123:

Hi,

whith MATLAB I wrote an ASCCI File with several lines like:

2014/3/3/00:30  AUD  1 TD Wertpapiere Inflation (im Vergleich zum Vormonat) (FEB)
2014/3/3/00:30  AUD  1 TD Wertpapiere Inflation (im Vergleich zum Vorjahr) (FEB)
2014/3/3/00:50  JPY  2 Investitionsausgaben exkl. Software (4Q)
2014/3/3/00:50  JPY  2 Investitionsausgaben (4Q)
2014/3/3/00:50  JPY  1 Darlehen & Diskonte - Unternehmen (im Vergleich zum Vorjahr) (JAN)
2014/3/3/00:50  JPY  1 Company Profits (4Q)
2014/3/3/00:50  JPY  1 Company Sales (4Q)
2014/3/3/01:00  AUD  2 HIA Verkäufe von Neubauten (im Vergleich zum Vormonat) (JAN)
2014/3/3/01:01  GBP  1 Hometrack-Umfrage Wohnungsbau (im Vergleich zum Vormonat) (FEB)
2014/3/3/01:01  GBP  1 Hometrack-Umfrage Wohnungsbau (im Vergleich zum Vorjahr) (FEB)
2014/3/3/01:30  AUD  1 Vorräte (4Q)

I tried to read this with the following MT5 Code

Strange, no Error but also no information.

I hope that somebody has a hint for me.


Silas

If no information is printed, then your handle is invalid. Where is placed your file ?

I suggest you to add code to return the error (GetLastError()).