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

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

[Octave-bug-tracker] [bug #47553] textscan Whitespace characters differe


From: Philip Nienhuis
Subject: [Octave-bug-tracker] [bug #47553] textscan Whitespace characters different from Matlab
Date: Mon, 28 Mar 2016 19:18:44 +0000
User-agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:41.0) Gecko/20100101 Firefox/41.0 SeaMonkey/2.38

Follow-up Comment #6, bug #47553 (project octave):

As an example of the interplay/interference of the various
whitespace/delimiter/endofline defaults, consider this (ML r2016a prerel.):

>> str = ['1' char(8) '2' char(9) '3' char(10) '4' char(13) '5']
str =
2       3
4
5
>> uint8 (str)
ans =
   49    8   50    9   51   13   52   10   53
>> C = textscan (str, '%f');
>> C{1}'
ans =
     1     2     3     4
>> C = textscan (str, '%s', 'whitespace', [char(8) char(9) char(10) char(13)],
'delimiter', '');
>> C = C{1}
C = 
    '2  3'
    '4…'
>> uint8 (C{1})
ans =
   49    8   50    9   51
>> uint8 (C{2})
ans =
   52   13   53
%% => endofline \n still is a default delimiter

>> C = textscan (str, '%s', 'whitespace', [char(8) char(9) char(10) char(13)],
'delimiter', '', 'endofline', '');
>> C{1}
ans = 
    '2  3…'
>> C = C{1}
C = 
    '2  3…'
>> uint8(C{1})
ans =
   49    8   50    9   51   10   52   13   53
>> C = textscan (str, '%s', 'endofline', '');
>> C{1}'
ans = 
    '1'    '2'    '3…'
>> C = C{1}; uint8 (C{3})
ans =
   51   10   52   13   53
>> 


Sigh.

    _______________________________________________________

Reply to this item at:

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

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




reply via email to

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