Hello, last time I learned how to avoid that when I write to a CSV it overwrite the same file ( FileSeek(filehandle,0,SEEK_END); )
Now my problem is that after writing,even without closing the file, it change row every time it write.
I also tried with txt file, and it write row after row. I need to write to the same row and I don't know if there is a function for this or if it is possible .
Why is it that newbie coders never bother to read the documentation?
Read the documentation!
- File Functions
- FileWriteString() and all the other FileWrite??? functions as well!!!
- www.mql5.com
Why is it that newbie codes never bother to read the documentation?
Read the documentation!
- File Functions
- FileWriteString() and all the other FileWrite??? functions as well!!!
That's not an answer to the question.
There is no need to become angry.
Yes, it is! Using the FileWriteString and/or other FileWrite??? functions allows you to control when the new line/row is produced and not automatically after the standard FileWrite function, just as the OP requested!
An I quote the docs:
The function writes the value of a string-type parameter into a BIN, CSV or TXT file starting from the current position of the file pointer. When writing to a CSV or TXT file: if there is a symbol in the string '\n' (LF) without previous character '\r' (CR), then before '\n' the missing '\r' is added.
Yes, it is! Using the FileWriteString and/or other FileWrite??? functions allows you to control when the new line/row is produced and not automatically after the standard FileWrite function, just as the OP requested!
An I quote the docs:
Ok maybe, I understood the question in an other way. We will wait OP answer.
To elaborate, the OP can use the FileWriteString or other FileWrite??? functions several times and it will never generate a new line/row until he finalizes it with a "\n" somewhere in the output.
I need to write to the same row and I don't know if there is a function for this or if it is possible .
I think he is asking to update a row, not to avoid to write a new row (CR/LF).
Since he is Spanish and English is not his mother tongue, it can be interpreted to be either way, but I believe he wants to continue outputting to the same row after each call to FileWrite() and not actually go back and modify the existing output!
We will have to wait for the OP's explanation!
Why is it that newbie coders never bother to read the documentation?
Read the documentation!
- File Functions
- FileWriteString() and all the other FileWrite??? functions as well!!!
Thank You, I didn't know the function FileWriteString because I am not writing strings but datas as double variables, anyway, I will read and hope to resolve my issue,
Thank's to all people who replied !! (If I will have problems I will ask here again ;-) ) Have a Good programming and a good trading !!
I think he is asking to update a row, not to avoid to write a new row (CR/LF).
Hello, (first, sorry for my English...)
What I asked is how to avoid that every time I write to the CSV it change row, I want all data o the same raw, later (if condition is done) I will change row.
I mean i don't want this:
I'd like this:
Anyway I have still not read the documentation I received, hope o solve this ;-)
Thank You again !
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hello, last time I learned how to avoid that when I write to a CSV it overwrite the same file ( FileSeek(filehandle,0,SEEK_END); )
Now my problem is that after writing,even without closing the file, it change row every time it write.
I also tried with txt file, and it write row after row.
I need to write to the same row and I don't know if there is a function for this or if it is possible .
Actually I use this code
if(filehandle!=INVALID_HANDLE)
{
FileSeek(filehandle,0,SEEK_END);
FileWrite(filehandle,Symbol(),EnumToString(ENUM_TIMEFRAMES(_Period)),hi,rangoenpuntos,DoubleToString(precioimprimir,5),NormalizeDouble(hhpuntos,5),NormalizeDouble(hhporcentaje,4),horafine );
FileWrite(filehandle,Symbol(),EnumToString(ENUM_TIMEFRAMES(_Period)),hi,rangoenpuntos,DoubleToString(precioimprimir,5),NormalizeDouble(hhpuntos,5),NormalizeDouble(hhporcentaje,4),horafine );
// FileClose(filehandle);
}
else Print("Operation FileOpen failed, error ",GetLastError());
}
Thank You. !!