bugGNU Octave - Bugs: bug #51093, textscan option...


bug #51093: textscan option MultipleDelimsAsOne does not apply to space or tab characters

Submitter:  Guillaume <gyom>
Submitted:  Tue 23 May 2017 10:39:46 AM UTC
Category:  Octave Function Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Incorrect Result
Status:  Fixed Assigned to:  None
Originator Name:  Guillaume Open/Closed:  * Closed
Release:  * dev Operating System:  * GNU/Linux
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup

Sun 29 Mar 2020 07:54:41 PM UTC, comment #3: 

I've made two patches to textscan recently.  I don't know if it was those, or some earlier work, but the motivating example in this bug report now works correctly.

I added a BIST test for this bug report just to make sure it doesn't recur (https://hg.savannah.gnu.org/hgweb/octave/rev/c805c1b541fa).

Marking as fixed and closing report.

Rik <rik5>
Group administrator
Wed 24 May 2017 11:25:14 AM UTC, comment #2: 

This may be related to deficiencies in the default sets of whitespace and delimiter characters.

Philip Nienhuis <philipnienhuis>
Group Member
Tue 23 May 2017 07:23:08 PM UTC, comment #1: 

Confirmed, same with either a space or tab character. Does not affect other more rare space characters like \f or \v.

Mike Miller <mtmiller>
Group Member
Tue 23 May 2017 10:39:46 AM UTC, original submission:  

The option MultipleDelimsAsOne does not seem to work under certain circumstances:

>> textscan(sprintf('a\t\tb\tc'),'%s','Delimiter','\t','MultipleDelimsAsOne',false)
ans =
  [1,1] =
    [1,1] = a
    [2,1] = b
    [3,1] = c

Matlab returns {{'a';'';'b';'c'}} as expected. It works with a different delimiter, eg:

>> textscan('a//b/c','%s','Delimiter','/','MultipleDelimsAsOne',false)
ans =
  [1,1] =
    [1,1] = a
    [2,1] =
    [3,1] = b
    [4,1] = c

Guillaume <gyom>


(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:

No files currently attached


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -email is unavailable- added by rik5 (Posted a comment)
  • -email is unavailable- added by philipnienhuis
  • -email is unavailable- added by mtmiller (Posted a comment)
  • -email is unavailable- added by gyom (Submitted the item)

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only group members can vote.


    Follow 5 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2020-03-29 rik5 StatusConfirmed Fixed
        Open/ClosedOpen Closed
    2017-05-28 philipnienhuis Carbon-Copy- Added philipnienhuis
    2017-05-23 mtmiller StatusNone Confirmed
        Summarytextscan with option MultipleDelimsAsOne textscan option MultipleDelimsAsOne does not apply to space or tab characters

    Back to the top

    Powered by Savane 3.13-4b48.
    Corresponding source code