Originally Posted by
DarrinTE
Thanks, but my code is really long and I really only need to know if anyone knows a better way to read data from text file and why sscanf would skip data. I think it has something to do with overflow.
We only need the short code section where you're intializing the variables and calling scanf(), not the whole program.
The request for some sample lines from the file so we could see how it's formatted.
fscanf() and sscanf() are perfectly fine ways to read formatted data from a file. But they are very picky about correct formatting and target variable types.
Frankly, if the 1 line you did post is accurate... I think it has to do with missing commas in your variable list...
Code:
sscanf(sentence,"%s%s%s%s%s%s%s%s",tempId,tempPric, e,tempDate,myOffice,tempSold,tempCon,tempBed,tempA, dd);