Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: reading a data file to searches on Date
Date: Sun, 5 Oct 2008 14:28:01 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 29
Message-ID: <gcaith$rjn$1@fred.mathworks.com>
References: <gc7qv5$pv0$1@fred.mathworks.com> <gc8gqk$49v$1@fred.mathworks.com>
Reply-To: <HIDDEN>
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 1223216881 28279 172.30.248.35 (5 Oct 2008 14:28:01 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Sun, 5 Oct 2008 14:28:01 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1538001
Xref: news.mathworks.com comp.soft-sys.matlab:493698


Hi Andres,
Thank you very much.

John

"Andres " <rantore@werb.deNoRs> wrote in message <gc8gqk$49v$1@fred.mathworks.com>...
> "John Smith" <cc200802@yahoo.com> wrote in message <gc7qv5$pv0$1@fred.mathworks.com>...
> > Hi,
> >  I wanted to read in a file with the following format
> > 
> > Date  number number 
> > 
> > where date is a string such as "4-Oct-08" and numbers are floating point.
> > 
> >  I want to be able to do some searches (using find) on the Date. How do I read in the file such that I can do the searches on the date ?
> 
> Hi John,
> use textscan to read in the data, i.e. something like
> 
> fname = 'c:\jsmith.txt';
> fid = fopen(fname);
> A = textscan(fid, '%s %f %f');
> fclose(fid);
> 
> and if necessary apply one of the date functions (like datevec) to the first element of A (which stores the date strings in a cell array of strings). The respective doc pages will give you more insight into this.
> I hope this gets you started.
> Regards
> Andres