Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: how to read a file skipping all the text lines
Date: Tue, 19 Aug 2008 04:37:02 +0000 (UTC)
Organization: University of Memphis
Lines: 54
Message-ID: <g8dile$dol$1@fred.mathworks.com>
References: <g6qv69$4cu$1@fred.mathworks.com> <g6rkqj$611$1@canopus.cc.umanitoba.ca>  <7f58cd55-3107-4b4e-8b5b-bee2840f17d5@r15g2000prh.googlegroups.com>
Reply-To: <HIDDEN>
NNTP-Posting-Host: webapp-02-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1219120622 14101 172.30.248.37 (19 Aug 2008 04:37:02 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Tue, 19 Aug 2008 04:37:02 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 233092
Xref: news.mathworks.com comp.soft-sys.matlab:486155



beginner1.mat@hotmail.com wrote in message
<7f58cd55-3107-4b4e-8b5b-bee2840f17d5@r15g2000prh.googlegroups.com>...
> On Aug 18, 5:17=A0pm, "Paul " <p...@ceri.memphis.edu> wrote:
> > beginner1....@hotmail.com wrote in message
> >
> >
<94268f3f-48b4-45af-b762-be0eda8c3...@x16g2000prn.googlegroups.com>...
> >
> >
> >
> > > On Jul 30, 11:07=3DA0pm, rober...@ibd.nrc-cnrc.gc.ca
(Walter
> > Roberson)
> > > wrote:
> > > > In article <g6qv69$4c...@fred.mathworks.com>,
> >
> > > > Kushagra Mittal <kmit...@ymail.com> wrote:
> > > > >I want to read a ASCII file (given below). I only
want to
> > > > >read the numerical data in the form of a matrix
andskipall
> > > > >other textlinesand the last character in the file which
> > is ')'
> > > > >Please suggest me how to do it?
> >
> > > > Usetextscan(), telling it that ( and ) are comment
> > characters.
> >
> > > Is there a way to have more than one comment character?
> > Say, one of
> > > the lines starts with "Titles" and the other with
> > "Lables". =A0Can you
> > > set commentStyle to skip both of those lines?
> > > fid =3D3D fopen('data.txt');
> > > Data =3D3D textscan(fid, '%f%f', 'commentStyle',
['Titles',
> > 'Lables']);%
> > > This doesn't work, but wondering what would???
> > > fclose(fid);
> > > Thanks
> >
> > Try putting Titles and Lables in a cell array and see if
> > that works.
> 
> It didn't...seems like that is used for start and stop
when put into a
> cell array.


Sorry about that.  

What about declaring the '(' as a commentStyle and the ')'
as an endOfLine character?