The Math Forum

Search All of the Math Forum:

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

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

Notice: We are no longer accepting new posts, but the forums will continue to be readable.

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 ]

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:

l=' ';
while 1
if strfind(l,' Nmoves')>0,break,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

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]

© The Math Forum at NCTM 1994-2018. All Rights Reserved.