octave-maintainers
[Top][All Lists]
Advanced

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

[Bug] strread() elaborated format strings


From: Júlio Hoffimann
Subject: [Bug] strread() elaborated format strings
Date: Thu, 10 May 2012 09:27:44 -0300

Dear all,

strread('1 2 3 4 5 6',"%*n%n%*[^\n]")

The ugly format string above should produce 2 as output, i'm trying to reproduce the AWK capability of returning the 2-th column of a text file with textread() (which uses strread() under the hood).

Explaining the format:

%*n ignore the first number

%n get the second one

%*[^\n] ignore the longest non-empty string containing characters different of EOL.

In Octave 3.7.0+ from hg, the command produces an error:

strread('1 2 3 4 5 6',"%*n%n%*[^\n]")
error: strread: A(I): index out of bounds; value 1 out of bound 0
error: called from:
error:   /opt/octave/share/octave/3.7.0+/m/io/strread.m at line 294, column 7

Someone could confirm the bug?

Regards,
Júlio.

reply via email to

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