octave-maintainers
[Top][All Lists]
Advanced

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

Re: textscan


From: Philip Nienhuis
Subject: Re: textscan
Date: Thu, 26 Apr 2012 21:12:35 +0200
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1.11) Gecko/20100701 SeaMonkey/2.0.6

<follow-up cc'd to octave-maintainers ML>

Graf, Alexander wrote:
<snip>
> you recently posted a patch to make textscan faster. I like it
> because it seems to be able (after some small differences to ML
> I still have to sort out) to run on a large file on which I
> could so far only run textscan with ML.

Nice to hear, thanks.

> However, I think that in line 168 (of the readily patched
>  file<http://savannah.gnu.org/patch/download.php?file_id=25423>)
>
>        fskipl (fid, varargin{headerlines + 1});
>
> varargin should be replaced by args. At least that was necessary
> to run it with my script, where some parameters unknown to
> octave-textscan might have caused empty entries in varargin that
> are cleared out in args.

Hmmm, I think you are right. Good catch!
As my patch has already been pushed, I'll (try to) prepare a changeset this weekend.

BTW the reason of copying varargin to args isn't obvious to me either. In textread (which -like textscan- calls strread) similar logic works OK without this copy.
I'll look into this.

> I saw that you updated the patch 2 times after, but as far as I
> can see from looking into the patch files (I´m too stupid to run
> them, sorry) that particular issue wasn't changed yet.

Don't worry, my Mercurial proficiency also leaves much to be desired.
After you have downloaded the Octave sources, all you need to do is:
    hg import <patch_file>
and then build Octave, or copy the patched function files over to your local Octave installation. Maybe one can disentangle the changeset and then feed it to the patch command - I haven't tried that yet.

> BTW, are there any future plans to include the parameter
> "multipledelimsasone" (ML)? If not, I would take it out of my
> script and accept some empty columns...

??? This *IS* implemented. But not so much in textscan itself but rather in strread.m (which is called by textscan to do the dirty work).
(One motive is that textread can also benefit from this option.)

Admittedly, textscan's help text is a bit ambiguous:
<QUOTE>
`textscan' is a function from the file C:\Programs\Octave\Octave-3.6.1_MSVC2010\share\octave\3.6.1\m\io\textscan.m
<snip>
 -- Function File: [C, POSITION] = textscan (FID, ...)
     Read data from a text file or string.
<snip>
     In addition to the options supported by `strread', this function
     supports a few more:
</QUOTE>

... and the option explanations have been distributed differently over the various function help texts than ML did. Just perceive this as Octave not striving to be a carbon copy of ML :-)

Best wishes,

Philip

> Regards,
>
> Alex
>
> Dr. Alexander Graf
> Institut für Bio- und Geowissenschaften
> IBG-3: Agrosphäre
> Fon +49 (0)2461 61 8676
> Fax +49 (0)2461 61 2518


reply via email to

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