I have a text file which is attached. The file has some header lines, that have to be skipped. I am trying to read the data in the file with different choices such as load, importdata, and fscanf. I think only fscanf can be used here. Even with fscanf, I have some problems.
I used fscanf as :
[d,c1,c2,t]=fscanf(fid," %d %s %s %f", "C");
printf("%d %f\n", d,t)
x=fgetl(fid); % to skip remaining part of the line
This code is not perfect because:
(1) I have to manually count the number of lines in the text file. I don't know to apply automatic EOF.
(2) There are some missing data, given as "..." at the end. Here the numeric field is changed to character. How it can be solved?
So please tell me how to read this file and save the data into different variables.