octave-maintainers
[Top][All Lists]
Advanced

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

advice / help needed for reading formatted text (textscan, strread, & te


From: Ben Abbott
Subject: advice / help needed for reading formatted text (textscan, strread, & textread)
Date: Mon, 25 Oct 2010 13:38:59 +0800

The function textscan, strread, and textread currently are not fully compliant 
with ML. They each need expanded support of formats.

ML      supports the following format types; %d, %u, %f, %s, %q, %c, %[…], %[^…]

In addition it supports skipping entries, "%*f", and specifying precision, 
"%12.5f"

The job of handling this would be much easier if it were possible to do 
something like ...

        c = fscanf (fid, "%s %f %d %c %[TF]" ) 

or/and

        c = sscanf (str, "%s %f %d %c %[TF]") 

... and have "c" be returned as a [Nx5] cell array, where the "%s", "%c", and 
"%[TF]" entries are cell-strings and the other cell entries are numeric.

My first thought was write an m-file function to parse this, but maybe I'm 
missing something? Is there a simpler solution?

Ben


reply via email to

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