Path: news.mathworks.com!not-for-mail
From: "Wu Zhiyong" <wuzhiyong_163@163.com>
Newsgroups: comp.soft-sys.matlab
Subject: Re: about textread
Date: Sun, 1 Jun 2008 13:59:02 +0000 (UTC)
Organization: Sun-Yatsen University
Lines: 40
Message-ID: <g1u9v6$2i4$1@fred.mathworks.com>
References: <fu4tt6$rjq$1@fred.mathworks.com> <fu8ahh$c8m$1@fred.mathworks.com>
Reply-To: "Wu Zhiyong" <wuzhiyong_163@163.com>
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 1212328742 2628 172.30.248.35 (1 Jun 2008 13:59:02 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Sun, 1 Jun 2008 13:59:02 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1292814
Xref: news.mathworks.com comp.soft-sys.matlab:471634



"Andres Toennesmann" <rantore@werb.de> wrote in message 
<fu8ahh$c8m$1@fred.mathworks.com>...
> "Wu Zhiyong" <wuzhiyong_163@163.com> wrote in message
> <fu4tt6$rjq$1@fred.mathworks.com>...
> > I have a lot of data to read into matlab.They are 
printed 
> > in the textfile as followed:
> > 
> > airpressure staions  bias      MAE     RMSE    
HR          
> >   200.0       44   1.82511   2.34681  2.78835  22
> > airpressure staions  bias      MAE     RMSE    HR
> >  300.0        38   1.55661   1.83753  2.44242  26
> >  &#8230;&#8230;
> > I need to ignore the characters. [...]
> 
> You may try txt2mat from the file exchange with
> A = txt2mat('Filename',0,6,'BadLineString','air');
> This should result in the matrix 
> A = [200.0  44   1.82511   2.34681  2.78835  22
>      300.0  38   1.55661   1.83753  2.44242  26
>      ...]
> It would be interesting to know for me if this works
> reasonably fast.
> Regards
> Andres
> 
Thank you for your great work!
I'm going on with my work after a wonderful vacation.
yeah, Your code works fast.It really saves my time!
But one more question:
  How can I ignore the blank line?
for example:
airpressure staions  bias      MAE     RMSE    HR
 300.0        38   1.55661   1.83753  2.44242  26

airpressure staions  bias      MAE     RMSE    HR
 200.0       44   1.82511   2.34681  2.78835  22
........
Thanks very much!