|
On Oct 27, 9:39 pm, anandhi <anandhi.san...@gmail.com> wrote:
> On Oct 27, 9:54 pm, dpb <n...@non.net> wrote:
>
>
>
> > Anandhi wrote:
>
> > ...> When I use this prog I am able to get upto 100000 rows. How to get
> > > the rows beyond this till the end of file?
>
> > > block_size = 100000;
> > > format = '%f %f %f %f %f %f';
> > > file_id = fopen(fno{i});
> > > cnt=0;
> > > segarray = textscan(file_id, format, block_size);
>
> > ...
>
> > Don't specify N and textscan() should read to EOF
>
> > Alternatively, see
>
> > doc textscan
>
> > and note one can call textscan repeatedly on the same fid and continue
> > from where left off.
>
> > Doc doesn't indicate it, but N=-1 in textread() is a flag for "read to
> > end of file"; one would presume that would have been implemented in
> > textscan() as well. Also, I'd presume inf would have the same effect.
> > I can't test these hypotheses as my version predates textscan().
>
> > --
>
> Thanks for the response, however
>
> when i call textscan repeatedly on the same fid and continue
> it does continue upto 100000 lines only after which it does not
> continue.
>
> eg the file has 1179919 lines
>
> segarray = textscan(file_id, format);
> segarray1 = textscan(file_id, format);
>
> I still get the size of segarray1 empty
You could try using my CSVIMPORT submission from FEX (http://
tinyurl.com/yjctr57).
HTH,
Ashish.
|