help-octave
[Top][All Lists]
Advanced

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

Re: Loading ASCII data files quickly


From: Matthias Brennwald
Subject: Re: Loading ASCII data files quickly
Date: Mon, 10 Aug 2009 17:24:42 +0200

On Aug 10, 2009, at 5:03 PM, Christoph Ellenberger wrote:

I usually use sed to straighten the data and then do the load thing....
something like:

cmd=['sed -n -e "/^ *[0-9]/p" ' fname  ">" Tfname];
if (system(cmd,1))
  error("Fehler 1");
end

xx=load(Tfname);


where fname is the filename and tfname is some temporary filename which I remove afterword with....

cmd=["rm " Tfname];
if (system(cmd,1))
   error("Fehler 4");
end

but this depends on what structure do you want afterward. I sometimes have the coulumnames in the file as well and create a cellarray with the datapoints called Data.X, Data.Y etc. as well.

Hope this helps
Christoph

Ok, but this requires sed to be available. My code needs to work with non-unixy machines, too.


----
Matthias Brennwald, Käferholzstrasse 173, CH-8046 Zürich, +41 44 364 17 03




reply via email to

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