help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: CSVs, .DATs


From: CdeMills
Subject: Re: CSVs, .DATs
Date: Wed, 2 May 2012 07:43:22 -0700 (PDT)

It looks like it's a job for the dataframe package (see
http://octave.sourceforge.net/dataframe/index.html). If I take your example
and remove lines 2 to 4, I get:

x=dataframe("CR800-14-1-12_short.dat");

size(x)
ans =

   1134     20

>>x(1:5,4)
ans = dataframe with 5 rows and 4 columns           
Src: CR800-14-1-12_short.dat                        
_1                _TOA5_ _CR800_GEC_ _CR800_ _19126_
Nr                  char      double  double  double
 1 "2012-01-06 15:30:00"        6357  8.3900  12.790
 2 "2012-01-06 15:40:00"        6358  8.4100  12.880
 3 "2012-01-06 15:50:00"        6359  8.4400  12.960
 4 "2012-01-06 16:00:00"        6360  8.4600  13.010
 5 "2012-01-06 16:10:00"        6361  8.4700  13.020

The idea is to implement something like R dataframe, which are a collection
of columns of heterogenous types. Data can latter be selected by index or
column names. Basic operations (+, - ...) can be done between dataframes, or
between dataframe and array of compatible side.

In its actual form, the two first lines analysed lines are expected to be in
the form "column name"; "column type". If you're interested, I would modify
the package in such a way that if the second line does not contain column
types, fields would just be appended to a per-column property list.

The package is already able to detect and process timestamps; but in your
case they are enclosed into quotes and considered as a string. They can be
processed with the strptime() function.

Pascal

Pascal


--
View this message in context: 
http://octave.1599824.n4.nabble.com/CSVs-DATs-tp4602895p4603404.html
Sent from the Octave - General mailing list archive at Nabble.com.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]