>>14321178I got you.
[code:lit]
FILE *f;
char inputbuf[1000];
if (fopen(f, "r") == -1) return 1;
int amount = fread(inputbuf,sizeof(char),sizeof(inputbuf)/sizeof(char), f)
fclose(f);
int quoted = -1;
for (int i = 0; i < amount; i++) {
if (buf
== '\"') quoted *= -1;
if (buf == ',' && quoted == -1) printf("new field\n");
}
[/code:lit]
this reads it into inputbuf, iterates over it. If the character is a quote it sets quoted to 1 and it switches it back to -1 at the next quote. If it reads a comma while quoted is not 1 it prints new field.