Path: news.mathworks.com!not-for-mail
From: "Branko " <bogunovic@mbss.org>
Newsgroups: comp.soft-sys.matlab
Subject: reading alphanumeric data
Date: Thu, 15 Oct 2009 10:32:03 +0000 (UTC)
Organization: National Institute of Biology
Lines: 47
Message-ID: <hb6tn3$891$1@fred.mathworks.com>
References: <hb6otr$oq4$1@fred.mathworks.com>
Reply-To: "Branko " <bogunovic@mbss.org>
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 1255602723 8481 172.30.248.37 (15 Oct 2009 10:32:03 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Thu, 15 Oct 2009 10:32:03 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 237386
Xref: news.mathworks.com comp.soft-sys.matlab:577482


"pathfinder Kunagu" <praveen.earth@gmail.com> wrote in message <hb6otr$oq4$1@fred.mathworks.com>...
> Hello Friends,
> I am doing some data processing thing.
> My data (alphanumeric) look like the following..having 10 columns, with typical notations.
> 
> Now the task is I want to extract data corresponding to selected dates & to process it.
> I've used 'textread' also but having problem with the second column bcz of those ':' symbol.
> 
> Plz let me know how to go ahead with this task.
> 
> 01-Jan-2001 23:59:53  -63.04  170.28  475.34  0 3   4014.662   6103.450 -50739.887
> 01-Jan-2001 23:59:54  -63.10  170.30  475.32  0 3   3974.387   6101.893 -50746.957
> 01-Jan-2001 23:59:55  -63.17  170.31  475.31  0 3   3934.606   6098.710 -50754.066
> 01-Jan-2001 23:59:56  -63.23  170.32  475.29  0 3   3896.105   6097.053 -50760.723
> 01-Jan-2001 23:59:57  -63.29  170.33  475.27  0 3   3856.992   6093.131 -50767.594
> 01-Jan-2001 23:59:58  -63.36  170.34  475.25  0 3   3817.332   6091.279 -50774.145
> 01-Jan-2001 23:59:59  -63.42  170.35  475.23  0 3   3778.741   6094.354 -50779.902
> 02-Jan-2001 00:00:00  -63.48  170.36  475.21  0 3   3740.585   6092.740 -50786.066
> 02-Jan-2001 00:00:01  -63.55  170.37  475.19  0 3   3701.370   6090.758 -50792.227
> 02-Jan-2001 00:00:02  -63.61  170.38  475.17  0 3   3662.072   6089.302 -50798.195
> 02-Jan-2001 00:00:03  -63.67  170.39  475.15  0 3   3622.398   6087.077 -50804.258
> 02-Jan-2001 00:00:04  -63.74  170.41  475.14  0 3   3583.234   6085.149 -50810.035
> 02-Jan-2001 00:00:05  -63.80  170.42  475.12  0 3   3543.696   6086.633 -50815.270
> 02-Jan-2001 00:00:06  -63.86  170.43  475.10  0 3   3504.965   6081.185 -50821.223
> 02-Jan-2001 00:00:07  -63.93  170.44  475.08  0 3   3466.551   6082.347 -50826.211
> 02-Jan-2001 00:00:08  -63.99  170.45  475.06  0 3   3427.262   6078.968 -50831.672
> 02-Jan-2001 00:00:09  -64.05  170.46  475.04  0 3   3388.032   6077.467 -50836.766
> 02-Jan-2001 00:00:10  -64.12  170.47  475.02  0 3   3348.961   6074.810 -50841.891
> 02-Jan-2001 00:00:11  -64.18  170.49  475.00  0 3   3309.816   6072.139 -50846.875
> 
> Praveen.

On possible solution:

% Read file
infid=fopen('data.txt','rt');
val=textscan(infid,'%s %s %f %f %f %f %f %f %f %f', 'CollectOutput', true);
fclose(infid);
% transform from cell to matrix
Data=cat(1,val{2});
Date=cat(1,val{1});
% Convert to julian dates
Date=datenum([cat(1,Date{:,1}) cat(1,Date{:,2})],'dd-mmm-yyyyHH:MM:SS');
%Complete dataset
DATA=[Date Data];

Branko