help-octave
[Top][All Lists]
Advanced

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

Re: io format specifier question


From: A. Kalten
Subject: Re: io format specifier question
Date: Tue, 1 Jul 2008 16:31:23 -0400

On Tue, 1 Jul 2008 21:37:38 +0200
"marco restelli" <address@hidden> wrote:

> 
> Still I wonder whether there is a format descriptor in octave which
> can handle this without preprocessing. The reason why I am insisting
> is that all the home made preprocessing 1) tends to make the data
> processing cumbersome when many files/people/systems are involved and
> 2) is likely to produce wrong results in various corner cases, which
> might be standard in some sense (in my case, according to the FORTRAN
> standard), but which I fail to take into account.
> 

Sorry about all the posts, but I'm still learning about octave myself.

There could some function somewhere to read Fortran data, but I
wouldn't know.

However, the octave regexprep() string function should work.  Just
read the data into string s and convert with:

regexprep(s,'([0-9])([+-])','$1e$2')

Then convert back to a double value with str2double()

The regular expressions can be modified to accommodate any
data variation.

This seems the simplest solution.

AK



reply via email to

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