Path: news.mathworks.com!not-for-mail
From: "Felipe Sediles" <felipe.sediles.nospam@mathworks.com>
Newsgroups: comp.soft-sys.matlab
Subject: Reading data into matlab
Date: Thu, 26 Jul 2007 22:40:27 +0000 (UTC)
Organization: Syracuse University
Lines: 31
Message-ID: <f8b7sr$gbt$1@fred.mathworks.com>
Reply-To: "Felipe Sediles" <felipe.sediles.nospam@mathworks.com>
NNTP-Posting-Host: webapp-01-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1185489627 16765 172.30.248.36 (26 Jul 2007 22:40:27 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Thu, 26 Jul 2007 22:40:27 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1066294
Xref: news.mathworks.com comp.soft-sys.matlab:421294


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

Where the last line of data is the line starting with 96615.  At present I'm going into this file and counting the number of headerlines, and the number of total lines of data.  This gets tedious and I will eventually have to read files where these values (the headerlines and total data lines) vary.  I basically want to use some kind of "landmark" in the data file to tell matlab where to begin and where to end.  Please help.  At present I'm using the textread function to read my data, so if possible, a solution using that function would be greatly appreciated!