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

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

[Octave-bug-tracker] [bug #58008] textscan: literals are managed differe


From: Philip Nienhuis
Subject: [Octave-bug-tracker] [bug #58008] textscan: literals are managed differently depending on delimiters
Date: Wed, 18 Mar 2020 16:27:12 -0400 (EDT)
User-agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:49.0) Gecko/20100101 Firefox/49.0 SeaMonkey/2.46

Follow-up Comment #2, bug #58008 (project octave):

BTW, In Matlab r2014a your example doesn't work either:

>> nm = textscan (txt, 'literal%s literal%s', 'Delimiter', ' ')
nm = 
    {2x1 cell}    {2x1 cell}
>> nm{1}
ans = 
    '_other_1_1'
    '_other_2_2\nliteral_other_3_1'
>> nm{2}
ans = 
    '_other_1_2\nliteral_other_2_1'
    '_other_3_2'
>> 


(empty lines removed)

Adding "\n" to delimiters or to 'endofline' makes no difference. '\r\n' as EOL
won't work either.

Matlab has known issues with "cuddling" literals (literals immediately
bordering fields). At the time (long ago) I was working on strread.m I've put
a lot of effort in properly processing of cuddling literals (because I needed
it myself). Unfortunately Octave's textscan, when turned into a (much faster)
compiled function, couldn't follow.


    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?58008>

_______________________________________________
  Message sent via Savannah
  https://savannah.gnu.org/




reply via email to

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