Last 52 lines are not written in csv file.
-
-
@dev_liya said in Last 52 lines are not written in csv file.:
QString str = QString::number(seq)+","+data[1]+","+data[2].trimmed();
You should check the size of data.
Also running your program in the debugger will show you where exactly it is crashing.
-
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.
-
And your last line do not start with "v1" ?
-
@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.