Solved Last 52 lines are not written in csv file.
-
@dev_liya Try to add write.flush() call before you call "return a.exec()" (after your loop).
-
Apart from all the stuff above - why do you need to covert
,
to;
- Excel and LibreOffice calc can import any csv file with a self-defined separator. -
@Christian-Ehrlicher What you said i cannot understand it.
-
@jsulm I have try it. the output is same nothing change.
-
And your last line do not start with "v1" ?
-
@dev_liya I also would close the file before calling "return a.exec()".
-
@Christian-Ehrlicher only first row contain v1 after all rows contain data.
-
@dev_liya Then remove all rows except the ones which are not put into the new file and try again. If they still don't get into the new file, please post the content of those lines.
-
@jsulm said in Last 52 lines are not written in csv file.:
@dev_liya I also would close the file before calling "return a.exec()".
@dev_liya
You should definitely do this (correctly). Without closing (or flushing) the file, the last "block" will not have been sent to the file when you do youra.exec()
--- it will still sit in memory. It seems likely this would be the cause of your "Last 52 lines are not written in csv file"? -
@jsulm @Christian-Ehrlicher @JonB
QString str = QString::number(seq)+","+data[1]+","+data[2].trimmed();
i have removed
"trimmed()"
from this line and also remove\n
from this below line.out<<str<<"\n";
then it has been print till 866261. after that not print. what is the problem i cannot under stand.
-
Reduce your file to see if it's the length or the specific line as already suggested
-
@dev_liya said in Last 52 lines are not written in csv file.:
then it has been print till 866261. after that not print. what is the problem i cannot under stand.
Have you acted on closing or flushing the file as suggested, or ignored that?
This is a separate question from why you got or have "The program has unexpectedly finished", which you must resolve if it's still happening. If it happens while writing lines to the file, you will indeed find further lines are missing, you must not get such an error.
-
@JonB I have tried flush and close. but i am not getting required output but getting same output as mentioned above. i am not getting any error. my program is working fine other then this issue.
-
- You might show your code now so we can check the
close()
. - Could you please state clearly whether or not you still get "Program has finished unexpectedly"?
- You might show your code now so we can check the
-
@jsulm @Christian-Ehrlicher @JonB my issue is solved thank you all for your help and reply. i have write wrong object name with
close()
. now my issue was solved. thank you all. and sorry for my mistake.