[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Octave-bug-tracker] [bug #52550] textscan drops delimiter character for
From: |
Dan Sebald |
Subject: |
[Octave-bug-tracker] [bug #52550] textscan drops delimiter character for multi-character, cell-specified delimiter option |
Date: |
Fri, 1 Dec 2017 18:35:15 -0500 (EST) |
User-agent: |
Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:55.0) Gecko/20100101 Firefox/55.0 |
Follow-up Comment #12, bug #52550 (project octave):
OK, thanks. I update again with a couple extra hunks to do the following:
(textscan::read_until): Treat eol1 and eol2 as delimiters.
(textscan::scan_string): Add eol1 and eol2 characters to "ends" string array.
It's odd that in the following:
octave:13> str = "99end2 space88gap 4564";
octave:14> c = textscan (str, "%d %s", "delimiter", {"end", "gap", "space"})
c =
{
[1,1] =
99
88
[1,2] =
{
[1,1] = 2
[2,1] = 4564
}
}
octave:15> str2 = "99,2 ,88, 4564";
octave:16> c2 = textscan (str2, "%d %s", "delimiter", ',')
c2 =
{
[1,1] =
99
88
[1,2] =
{
[1,1] = 2
[2,1] = 4564
}
}
octave:17> assert (c,c2)
that the space after the 2 is kept, but the space before the 4 is dropped.
(file #42549)
_______________________________________________________
Additional Item Attachment:
File name: octave-cell_specified_delimiter-bug52550-djs2017dec01.patch Size:5
KB
_______________________________________________________
Reply to this item at:
<http://savannah.gnu.org/bugs/?52550>
_______________________________________________
Message sent via/by Savannah
http://savannah.gnu.org/