Path: news.mathworks.com!newsfeed-00.mathworks.com!newsfeed2.dallas1.level3.net!news.level3.com!postnews.google.com!p25g2000hsf.googlegroups.com!not-for-mail
From: Engeltje <Engeltje81@gmail.com>
Newsgroups: comp.soft-sys.matlab
Subject: Re: extract dynamically the headerlines row numvber by string/number
Date: Wed, 2 Jul 2008 03:43:05 -0700 (PDT)
Organization: http://groups.google.com
Lines: 69
Message-ID: <cb6bb0d2-fbf2-4fbf-9ec2-d636a39e3d81@p25g2000hsf.googlegroups.com>
References: <2924bec5-2274-4b3b-8354-20b34f59add2@m3g2000hsc.googlegroups.com> 
NNTP-Posting-Host: 151.80.9.207
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
X-Trace: posting.google.com 1214995385 2669 127.0.0.1 (2 Jul 2008 10:43:05 GMT)
X-Complaints-To: groups-abuse@google.com
NNTP-Posting-Date: Wed, 2 Jul 2008 10:43:05 +0000 (UTC)
Complaints-To: groups-abuse@google.com
Injection-Info: p25g2000hsf.googlegroups.com; posting-host=151.80.9.207; 
User-Agent: G2/1.0
X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.1; it; rv:1.8.1.14) 
Xref: news.mathworks.com comp.soft-sys.matlab:477080



On 1 Lug, 17:20, "Andres " <rant...@werb.de> wrote:
> Engeltje <Engeltj...@gmail.com> wrote in message <155421db-
>
> 2dae-4c05-a69a-7bd91a8f6...@r66g2000hsg.googlegroups.com>...
> [..]
>
>
>
> > The problem I had I found a solution using the function
> > txt2mat(filename,0,1) I take the first colomn and then I
> made a
> > function that check if the result vector isnan (in this
> case increase
> > first index) else increase second index.
> > so thx to be interested!
> > Now I actually have a new problem!
> > I have some data in which part of the colomn is emtpy.
> > Example:
>
> > timestamp X Y value
> > 10
> > 20 3.2 3.4 4
> > 30
> > 40 1.2 2.7 10
>
> > I use:
> > values=textscan(filename,'%d %f %f %d',
> 4,'headerlines',1);
>
> > [TS,GazePointX,GazePointY,val]=values{:}
>
> > the problem is that it stops at TS=10, and the others are
> empty
> > Can u help me?
> > angelo
>
> Hi Angelo,
>
> did you try to use txt2mat with the filename as the only
> argument, i.e.
>
> A = txt2mat(filename)
>
> that would give
>
> A =
>    10.0000       NaN       NaN       NaN
>    20.0000    3.2000    3.4000    4.0000
>    30.0000       NaN       NaN       NaN
>    40.0000    1.2000    2.7000   10.0000
>
> for your example ? txt2mat has built in an automatic header
> line and column number detection. If you know the number of
> header lines in advance, you can also write
>
> A = txt2mat(filename,1)  % or
> A = txt2mat(filename,'NumHeaderLines',1)
>
> for a single header line, to be sure.
>
> Hth, regards
> Andres

Hi Andres!! unfortunally I've just tried it!
the problem is that my file is more complex then the one u've seen!!
if u want to have an idea...if u give me ur emali address I will send
it!
let me know!!
regards angelo