[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Octave-bug-tracker] [bug #52594] textscan continues past EOL
From: |
Dan Sebald |
Subject: |
[Octave-bug-tracker] [bug #52594] textscan continues past EOL |
Date: |
Tue, 5 Dec 2017 23:28:18 -0500 (EST) |
User-agent: |
Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:55.0) Gecko/20100101 Firefox/55.0 |
Follow-up Comment #1, bug #52594 (project octave):
Thanks for the report. We've been in the process of correcting a few things
related to textscan(). To be more accurate, you've mention NAN, but your
example is scanning for %s, so I'm assuming you meant empty entry.
Let's consider this example:
octave:3> textscan(sprintf('this,is\r\na,test'), '%s%s%s', 2, 'delimiter',
',','EndofLine','\r\n')
ans =
{
[1,1] =
{
[1,1] = this
[2,1] = test
}
[1,2] =
{
[1,1] = is
}
[1,3] =
{
[1,1] = a
}
}
Your description suggests the desired result should be:
ans =
{
[1,1] =
{
[1,1] = this
[2,1] = a
}
[1,2] =
{
[1,1] = is
[2,1] = test
}
[1,3] =
{
[1,1] = [](0x0)
[2,1] = [](0x0)
}
}
?? That last entry ans{1,3}(2,1) being empty?
Similarly, for numeric input:
octave:16> x = textscan(sprintf('1,2\r\n3,4'), '%d%d%d', 2, 'delimiter',
',','EndofLine','\r\n')
x =
{
[1,1] =
1
4
[1,2] = 2
[1,3] = 3
}
should be
x =
{
[1,1] =
1
3
[1,2] =
2
4
[1,3] =
NaN
NaN
}
??
_______________________________________________________
Reply to this item at:
<http://savannah.gnu.org/bugs/?52594>
_______________________________________________
Message sent via/by Savannah
http://savannah.gnu.org/