read csv file with header in c.
- csv file format:
- delimeter: ","
- first row is header text, and the remaining rows are all digit.
CSVFILE file;
if(csvOpen(&file, "./sample.csv")){
while(csvReadLine(&file)){
printf("field c: %lf\n", file.GetField(&file, "c"));
}
}
void onCsvUpdate(CSVFILE *file){
printf("field m: %lf\n", file->GetField(file, "m"));
}
csvReadCallback("./sample.csv", onCsvUpdate);