This question is about reading large sets of formatted data from a file.
For a file containing two columns, we can read each column in with the fscanf function:
Code:fscanf(file, '%f %f',data, data);
This is great when there is a small, known number of columns of data. But what is typically done when the number of columns is very large, or is unknown. The above strategy becomes very limiting. Is there an easy way to read in formatted data item by item in a loop until the end of the line is reached? How is this task typically coded?
Thanks in advance