help-octave
[Top][All Lists]
Advanced

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

Re: regex-matched formatted input, or selecting a few columns in a CSV f


From: Muthiah Annamalai
Subject: Re: regex-matched formatted input, or selecting a few columns in a CSV file?
Date: Wed, 16 Jan 2008 02:14:51 -0600
User-agent: Thunderbird 2.0.0.6 (X11/20071022)

novakyu wrote:
Hi,

I am trying to read from a CSV file, where all the numerical data is
on the 4th and 5th column (1-3rd columns contain additional
information about instruments). Is there a way to read it directly
into Octave using something similar to fscanf? So far, I've been
re-writing the data files using Perl and then loading it into Octave,
but it's getting a little tedious to keep doing it that way. Here's a
sample of the data that I want to read:

Record Length,2.500000e+03,,  -0.046000000000,  -1.44000,
Sample Interval,2.000000e-04,,  -0.045800000000,  -1.44000,
Trigger Point,2.300000000000e+02,,  -0.045600000000,  -1.44000,
,,,  -0.045400000000,  -1.44000,
,,,  -0.045200000000,  -1.44000,
,,,  -0.045000000000,  -1.44800,

As you can see, actual X and Y values are on the third and fourth columns.

Thank you,

Andrzej

Octave has support for fscanf(), regexp() and friends, and since you use PERL already,
you can write your own specific data loader.
-Muthu



reply via email to

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