octave-bug-tracker
[Top][All Lists]
Advanced

[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: Wed, 29 Nov 2017 00:02:38 -0500 (EST)
User-agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:55.0) Gecko/20100101 Firefox/55.0

URL:
  <http://savannah.gnu.org/bugs/?52550>

                 Summary: textscan drops delimiter character for
multi-character, cell-specified delimiter option
                 Project: GNU Octave
            Submitted by: sebald
            Submitted on: Wed 29 Nov 2017 05:02:37 AM UTC
                Category: Octave Function
                Severity: 3 - Normal
                Priority: 5 - Normal
              Item Group: Incorrect Result
                  Status: None
             Assigned to: None
         Originator Name: 
        Originator Email: 
             Open/Closed: Open
         Discussion Lock: Any
                 Release: dev
        Operating System: Any

    _______________________________________________________

Details:

In a comment of a bug report related to lost whitespace delimiters in
textscan

https://savannah.gnu.org/bugs/?52479#comment12

it was noted that for consecutive delimiters in an input string when a
delimiter is specified as a single character, the code works:


octave:1> a = "\t\ta\tb\tc\n";
octave:2> textscan(a, '%s', 'delimiter', sprintf('\t'))
ans =
{
  [1,1] =
  {
    [1,1] = 
    [2,1] = 
    [3,1] = a
    [4,1] = b
    [5,1] = c
  }

}


But when the same character is presented as part of a cell array it is one
entry too short.


octave:4> textscan(a, '%s', 'delimiter', {sprintf('\t')})
ans =
{
  [1,1] =
  {
    [1,1] = 
    [2,1] = a
    [3,1] = b
    [4,1] = c

  }

}






    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?52550>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

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