Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Text file with numbers and text, want to just read numbers
Date: Fri, 4 Jul 2008 10:52:01 +0000 (UTC)
Organization: Pierburg GmbH
Lines: 25
Message-ID: <g4kvch$bu0$1@fred.mathworks.com>
References: <g4jc5p$341$1@fred.mathworks.com> <g4kqmi$ook$1@fred.mathworks.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 1215168721 12224 172.30.248.37 (4 Jul 2008 10:52:01 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Fri, 4 Jul 2008 10:52:01 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 872224
Xref: news.mathworks.com comp.soft-sys.matlab:477520



"Jos " <DELjos@jasenDEL.nl> wrote in message 
<g4kqmi$ook$1@fred.mathworks.com>...
[..]
> 2) determine at which lines data starts, e.g. line X
>    This is the real problem!
>    p = regexp(s,'[A-Za-z]') will give a cell array with 
non-
> empty cells when a line contains text (but how to deal 
with 
> scientific notation ...). See help regexp for more 
options.
>    X = max(find(~cellfun('isempty',p))) + 1
> 
[..]

That's the crux! Depending on what you know in advance 
about the file, you have to care about scientific notation, 
as you mentioned, final header lines containing delimiters, 
signs, whitespaces or other special characters only or just 
being empty, and possibly NaN and Inf occurrences in the 
number section.
All in all, this can result in quite a lengthy piece of 
code.

Andres