read an empty line in a file
Show older comments
hello everybody, I'm french so escuse me for my english... I've a problem, I have to read a file with matlab and it contains empty line for exemple :
<Node name="root" gravity='0 0 0' dt="0.01"
<EulerImplicitSolver name="cg_odesolver" printLog="0" etc etc
matlab read the first line and stop the reading . I did :
fid = fopen(name,'rt');
tline = fgetl(fid);
while (tline~=-1)
tline = fgetl(fid);
....
....
end
fgetl(fid) returns :
tline =
''
I don't know what I have to do... thnak you very much
Accepted Answer
More Answers (2)
Fangjun Jiang
on 10 Aug 2011
0 votes
use while ~feof(fid) instead
trajik
on 10 Aug 2011
0 votes
Categories
Find more on String Parsing 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!