Path: news.mathworks.com!newsfeed-00.mathworks.com!kanaga.switch.ch!switch.ch!news.in2p3.fr!in2p3.fr!feeder1-2.proxad.net!proxad.net!feeder1-1.proxad.net!198.186.194.250.MISMATCH!news-out.readnews.com!news-xxxfer.readnews.com!postnews.google.com!g1g2000vbr.googlegroups.com!not-for-mail
From: anandhi <anandhi.sankar@gmail.com>
Newsgroups: comp.soft-sys.matlab
Subject: Re: read large text files
Date: Tue, 27 Oct 2009 20:39:18 -0700 (PDT)
Organization: http://groups.google.com
Lines: 43
Message-ID: <b976d3af-5074-4042-8ca3-d96de0e02de8@g1g2000vbr.googlegroups.com>
References: <hc85sr$f4q$1@fred.mathworks.com> <hc88hj$k9a$1@news.eternal-september.org>
NNTP-Posting-Host: 76.15.43.104
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
X-Trace: posting.google.com 1256701159 21636 127.0.0.1 (28 Oct 2009 03:39:19 GMT)
X-Complaints-To: groups-abuse@google.com
NNTP-Posting-Date: Wed, 28 Oct 2009 03:39:19 +0000 (UTC)
Complaints-To: groups-abuse@google.com
Injection-Info: g1g2000vbr.googlegroups.com; posting-host=76.15.43.104; 
	posting-account=Slkq-goAAACbRuqmB9XjUG78Ose9KNzY
User-Agent: G2/1.0
X-HTTP-UserAgent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; .NET CLR 
	1.1.4322; .NET CLR 2.0.50727; InfoPath.1; .NET CLR 3.0.4506.2152; .NET CLR 
	3.5.30729),gzip(gfe),gzip(gfe)
Xref: news.mathworks.com comp.soft-sys.matlab:580509


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