Stan
Posts:
52
Registered:
6/18/12
|
|
Re: Pull out specific numbers from unstructured text file
Posted:
Feb 8, 2013 2:51 PM
|
|
Ok, I get the idea. Here is what I tried:
fid=fopen(....,'rt'); l=' '; while 1 l=fgetl(fid); if strfind(l,' Nmoves')>0,break,end end Nmoves=sscanf(l,' Nmoves=%d'); Nrequired=fscanf(fid,' Nrequired=%d'); %up until here, no changes l=fgetl(fid); %added this line Tot_RL=sscanf(l,' TotRL= %f'); %added this line fid=fclose(fid);
I am getting: > Tot_RL =
[ ]
Is something missing with the second fgetl() line?
|
|