If this has been answered, forgive me.
I have a series of files that I need to read in. I only care about the first field (seperated by spaces) on each line and each line is varying lengths.
for example:
Code:
0200 this is the total number of widgets we need
0030 this can be what ever
Is there a way to use fscanf to read in the part I want and then move the file position pointer to the next line?
Currently a fgets is being used and the data read is just trashed, it just seems there would be a better way than doing a disk read for no reason. Is there?
current solution:
Code:
fscanf(file,"%x",buf);
fgets(garbageBuffer,number,file);
//next line
fscanf(file,"%x",buf);
fgets(garbageBuffer,number,file);
// and so on
thanks