[ARCHIVE] Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Nowhere without you - 3. - page 608

 
T-G: how to programmatically skip the first line
It's simple:
FileReadString(ExtCsvHandle);
 
alsu:
It's simple:
i.e. just count, but don't memorise it anywhere, discard it as unnecessary.
 
alsu:
In your example, the only difference is when parameters are passed to the function
Why then does the dellline function delete lines with these names in the first variant, but not in the second?
 
Fox_RM:
Why then does the dellline function delete lines with these names in the first variant, but not in the second?


1) down_line+TimeToStr

2) " downline_"+TimeToStr

dellline(up_line, down_line );

 
Solree:
There is no MT in my MT. There is only 1 library written in MQL (stdlib.mq4). Can you throw an example here?
Everyone has one. Look here: ...\MetaTrader 4\experts\samples\DLLSample
 
Zhunko:
Everybody's got one. Look here: ...MetaTrader 4\experts\samples\DLLSample
Wrong place. Thank you. Looks like you need some god-awful Visual C++. But maybe someone knows how to build for MinGW? Tried to compile and link the whole example, doesn't see it, doesn't give a damn...
 
Solree:
I was looking in the wrong place. Thank you. Looks like it's going to need God-awful Visual C++. But maybe someone knows how to build under MinGW? Tried to compile and link the whole example, doesn't see it, doesn't give a damn...
I build everything in mingw under codeblocks fine. What exactly is the problem?
 

Please advise the situation is as follows, I read a csv file like this

void ReadDate(){
   while(!IsStopped()){
      string dTime = FileReadString(ExtCsvHandle); // читаем строчку 1
      string sValue = FileReadString(ExtCsvHandle); // читаем строчку 2
      Print("Date=",StrToTime(dTime), "Value=",sValue);   
      
   }
}

but csv file has a header, the first extra line

Time,Value
15.02.2012 00:00:00;Значение1
15.02.2012 00:01:07;Значение2
15.02.2012 00:02:26;Значение3
15.02.2012 00:00:00;Значение1
15.02.2012 00:01:07;Значение2
15.02.2012 00:02:26;Значение3

how to programmatically skip the first line, or programmatically delete in general when saving the value it spoils everything.

Thanks in advance.

alsu:

It's simple:

FileReadString(ExtCsvHandle);


And where should I put it? Before the loop? That would confuse things... I just need to skip the header

Time,Value
 
T-G:


And where should I put it? Before the loop? That would confuse things... I just need to skip the header


You can put it before the loop, you can put it in the body... And why would it confuse you, is the problem that the header is not the first line and you don't know when it will be encountered?
 

Like this, for example, the headline will be omitted

void ReadDate(){
   FileReadString(ExtCsvHandle); //Пропускаем 'Time'
   FileReadString(ExtCsvHandle); //Пропускаем 'Value'
   while(!IsStopped()){
      string dTime = FileReadString(ExtCsvHandle); // читаем строчку 1
      string sValue = FileReadString(ExtCsvHandle); // читаем строчку 2
      Print("Date=",StrToTime(dTime), "Value=",sValue);   
      
   }
}