Unable to read completely a text file
Show older comments
I have the following text file at the bottom, where every line ends with a semicolon. I am unable to read the entire file with these commands. I only obtain the content of the first line. Any help in reading the entire file would be greatly appreciated.
Thanks.
fileID = fopen(filename);
data = textscan(fileID, '%d %f %d %d %d', 'EndOfLine', ';')
fclose(fileID);
"filename.txt"
37 0.033 119 131 7;
38 0.034 138 138 8;
39 0.035 138 144 9;
40 0.035 138 150 10;
41 0.036 157 157 11;
42 0.037 157 163 12;
43 0.038 157 169 13;
44 0.039 176 176 14;
45 0.040 176 182 15;
46 0.041 176 189 17;
47 0.042 195 195 18;
48 0.043 195 202 20;
49 0.043 195 208 21;
50 0.044 215 215 23;
Accepted Answer
More Answers (0)
Categories
Find more on Text Files in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!