Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

Views expressed in these public forums are not endorsed by Drexel University or The Math Forum.


Math Forum » Discussions » Software » comp.soft-sys.matlab

Topic: Pull out specific numbers from unstructured text file
Replies: 13   Last Post: Aug 8, 2014 6:51 AM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
Stan

Posts: 63
Registered: 6/18/12
Re: Pull out specific numbers from unstructured text file
Posted: Feb 8, 2013 2:51 PM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

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?



Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.