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: reading text file line by line
Replies: 10   Last Post: Aug 4, 2012 8:50 AM

Advanced Search

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

Posts: 66
Registered: 3/19/09
Re: reading text file line by line
Posted: Aug 3, 2012 10:36 PM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

dpb <none@non.net> wrote in message <jvhrcd$cbp$1@speranza.aioe.org>...
> On 8/3/2012 6:15 PM, Leyo Joseph wrote:
> ...
>

> >> fid=fopen('yourfile','rt');
> >> a=fgetl(fid);
> >> while ~feof(fid)
> >> l=fgetl(fid);
> >> if ~isempty(l)
> >> a=strvcat(a,l);
> >> end
> >> end
> >> c=cellstr(a);
> >>

> > Thanks for thr help... I am getting closer, but need one more analysis.
> > When I try the above, for example , I get c(5,1)
> >
> > ans =
> > ' 0x3029 0x04548ecf'
> >
> > how to copy 0x04548ecf from c(5,1) to a variable?. I wan to do this for
> > other (c:,1)

>
> In what form do you want the result?
>
> If you're looking for the numeric value use hex2dec()
>
> -

I think, I didn't explain it well.
How to take out 0x04548ecf from c(1,5) (C(1,5) is ' 0x3029 0x04548ecf'
) Once I take out 0x04548ecf I can connvert to dec and assign to a varaible.



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.