C write data after 1024 lines in a csv file -
i trying write data in csv
file per 1024 lines:
fprintf(fp, "%f %f \1024n", a, b)
what right way write per 1024
lines?
first of have use loop:
int i=0; for(i=0; i<1024;i++) { fprintf(fp, "%f %f\n", a, b); }
secondly add semicolon between values. grants csv opened automatically excel dividing values in colums:
int i=0; for(i=0; i<1024;i++) { fprintf(fp, "%f;%f\n", a, b); }
edit leave 1024 empty lines can
int i=0; fprintf(fp, "%f;%f\n", a, b); // print nd b values // loop write 1024 empty lines for(i=0; i<1024;i++) { fprintf(fp, "\n"); }
Comments
Post a Comment