|
|
Re: reading text file line by line
Posted:
Aug 3, 2012 7:15 PM
|
|
dpb <none@non.net> wrote in message <jvhl22$e9$1@speranza.aioe.org>... > On 8/3/2012 5:27 PM, Leyo Joseph wrote: > ... > > > Is it possible to read in such a way that A(1,1) is the first whole > > line, A(1,2) is the second whole line so on... > ... > > That's what the other solution does--returns a cell string, one per record. > > Alternatively, try > > A=cellstr(A); > > Probably easiest to get rid of the blank lines is to do so after reading > the full file into memory. > > Alternatively, > > 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) Thnaks
|
|