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 00:17:03 +0000 (UTC)
Organization: University of Memphis
Lines: 31
Message-ID: <g8d3dv$kr7$1@fred.mathworks.com>
References: <g6qv69$4cu$1@fred.mathworks.com> <g6rkqj$611$1@canopus.cc.umanitoba.ca> <94268f3f-48b4-45af-b762-be0eda8c3364@x16g2000prn.googlegroups.com>
Reply-To: <HIDDEN>
NNTP-Posting-Host: webapp-05-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1219105023 21351 172.30.248.35 (19 Aug 2008 00:17:03 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Tue, 19 Aug 2008 00:17:03 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 233092
Xref: news.mathworks.com comp.soft-sys.matlab:486137



beginner1.mat@hotmail.com wrote in message
<94268f3f-48b4-45af-b762-be0eda8c3364@x16g2000prn.googlegroups.com>...
> On Jul 30, 11:07=A0pm, 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".  Can you
> set commentStyle to skip both of those lines?
> fid =3D fopen('data.txt');
> Data =3D 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.