help-octave
[Top][All Lists]
Advanced

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

Re: Handling heterogeneous files


From: Rob Mahurin
Subject: Re: Handling heterogeneous files
Date: Thu, 25 Jun 2009 17:19:18 -0400

On Jun 18, 2009, at 5:39 PM, ws wrote:
I often have data files that have different types in their columns -- for example, an ISO timestamp in the first column (like "1990-03-04T14:01:01"), floats in the other columns, and the occasional string columns (["ok"; "ok";
"notok"; ...]).

Is there an easy way to import these and deal with them in octave/ matlab? I especially would be happy if there were an automagic conversion of dates to Julian times, strings to integers (like factors), or whatever. If there is a way to get it into a cell array, that would be OK, too. What I want to avoid
is writing a looping function with a bunch of calls to scanf ...

Look at "textread" in the io package on octave-forge for messy input files.

The "date" program in GNU coreutils is pretty good for automagic date/ time conversion. It doesn't have julian output but there is time_t output (%s) which is okay. If you know the date format you can use strptime within octave.

Cheers,
Rob

--
Rob Mahurin
University of Manitoba, Dept. of Physics & Astronomy
at:     Oak Ridge National Laboratory   865 207 2594
        Oak Ridge, Tennessee            address@hidden






reply via email to

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