Path: news.mathworks.com!newsfeed-00.mathworks.com!NNTP.WPI.EDU!elk.ncren.net!newsflash.concordia.ca!canopus.cc.umanitoba.ca!not-for-mail
From: roberson@ibd.nrc-cnrc.gc.ca (Walter Roberson)
Newsgroups: comp.soft-sys.matlab
Subject: Re: Reading data into matlab
Date: Thu, 26 Jul 2007 23:21:08 +0000 (UTC)
Organization: National Research Council Canada - Conseil national de rechereches Canada
Lines: 46
Message-ID: <f8ba94$fhe$1@canopus.cc.umanitoba.ca>
References: <f8b7sr$gbt$1@fred.mathworks.com>
NNTP-Posting-Host: origin.ibd.nrc.ca
X-Trace: canopus.cc.umanitoba.ca 1185492068 15918 192.70.172.160 (26 Jul 2007 23:21:08 GMT)
X-Complaints-To: abuse@cc.umanitoba.ca
NNTP-Posting-Date: Thu, 26 Jul 2007 23:21:08 +0000 (UTC)
Originator: roberson@ibd.nrc-cnrc.gc.ca (Walter Roberson)
Xref: news.mathworks.com comp.soft-sys.matlab:421301


In article <f8b7sr$gbt$1@fred.mathworks.com>,
Felipe Sediles <felipe.sediles.nospam@mathworks.com> wrote:
>Hi, I'm trying to read data off of a file that has more than just one
>set of data, and more than just data.  I want to be able to tell matlab
>where to start reading without having to know before hand how many
>headerlines to skip.  For example, my data file looks something like:

>*Heading
>** Job name: STB_model33 Model name: Model-1
>** Geometry: half thickness =  5.800000200, width = 50.799999200, beta = 1/16th, gamma =  0.000000000
>*Preprint, echo=No, history=NO, contact=NO
>**
>**Parts
>**
>*Part, name=Part-1
>*End Part
>**
>*Part, name=torque_block2
>*End Part
>**
>**
>** ASSEMBLY
>**
>*Assembly, name=Assembly
>**
>*Instance, name=Part-1-1, part=Part-1
>*Node
>1,	 -31.750000000,	  0.000000000,	  3.174999960
>2,	 -31.750000000,	  5.800000200,	  3.174999960
>
>***********more data************
>
>96615,	  5.352380838,	 -5.800000200,	  2.381249900
>*Element, type=C3D20

For your purposes, would it suffice to set '*' to be one
of the comment characters? That would eliminate all of the header lines
you show, and would eliminate the line after the data; on the other
hand, if there are other lines further down in the file that do not
start with * then it would calmly read those.


Myself, in a case like this, I'd just use a bit of perl or sed
-- 
  There are some ideas so wrong that only a very intelligent person
  could believe in them.                              -- George Orwell