Path: news.mathworks.com!newsfeed-00.mathworks.com!newsfeed2.dallas1.level3.net!news.level3.com!postnews.google.com!news1.google.com!news.glorb.com!news2.glorb.com!tr22g12.aset.psu.edu!news.mathforum.org!not-for-mail
From: AMK <kennaster@gmail.com>
Newsgroups: comp.soft-sys.matlab
Subject: How to import timestamp (5:48:05 ) to a format ML can handle
Date: Tue, 06 Oct 2009 15:56:50 EDT
Organization: The Math Forum
Lines: 21
Message-ID: <1213675765.22507.1254859042177.JavaMail.root@gallium.mathforum.org>
NNTP-Posting-Host: gallium.mathforum.org
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-Trace: support1.mathforum.org 1254859042 17561 144.118.94.39 (6 Oct 2009 19:57:22 GMT)
X-Complaints-To: news@news.mathforum.org
NNTP-Posting-Date: Tue, 6 Oct 2009 19:57:22 +0000 (UTC)
Xref: news.mathworks.com comp.soft-sys.matlab:575432


Hi,
I have a datafile that I'm reading into ML and am stuck on how to get the timestamp into ML in a form that it will be able to handle.  Here is my current import script.  Any suggestions?  The whole file is tab delimited but the timestamp cell has :, which I hope may be of some help here.

[code]
fnames = dir('*.ddf');
dr1 = 10; dc1 = 1; dr2 = 10; dc2 = 1; %This defines where the time is located within the .ddf file
dtcols = (dr2-dr1)+1; %Defines length of the data column
dtrows = length(fnames);  %Defines the length of the data rows
ch1_dt = zeros(dtrows, dtcols);    %Initializes a matrix to store the data
for n = 1:length(fnames)    %Start the for loop for the file names
  ch1_dt(n,:) = dlmread(fnames(n).name, '\t', [dr1 dc1 dr2 dc2])'; %Read in the data
  end %End the loop
[/code]

Here is a sample of the '\t' delimited datafile:
date	9/30/2009
time	5:48:05

Obviously, my next question will be how to import the date too, but that's less critical.

Thanks