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: Rik
Subject: [Octave-bug-tracker] [bug #58008] textscan: literals are managed differently from Matlab depending on delimiters
Date: Sat, 28 Mar 2020 15:08:15 -0400 (EDT)
User-agent: Mozilla/5.0 (Windows NT 10.0; WOW64; Trident/7.0; rv:11.0) like Gecko

Update of bug #58008 (project octave):

                Priority:              5 - Normal => 2                      
              Item Group:        Incorrect Result => Matlab Compatibility   
                  Status:            Works For Me => Confirmed              
                 Summary: textscan: literals are managed differently depending
on delimiters => textscan: literals are managed differently from Matlab
depending on delimiters

    _______________________________________________________

Follow-up Comment #9:

Re-categorizing as Matlab Compatibility.

The following code works in Matlab R2020a.


txt = sprintf
('literal_other_1_1;literal_other_1_2\nliteral_other_2_1;literal_other_2_2\nliteral_other_3_1;literal_other_3_2')
nm = textscan (txt, 'literal%s literal%s', 'Delimiter', ';')


However, the following does not


nm = textscan (txt, 'literal%s;literal%s', 'Delimiter', ';')


Clearly, there are subtle issues with both Octave's and Matlab's
implementation.  If I have a data format that is even remotely complicated I
would choose an external solution, such as Perl, to process the data in to a
more ordinary form that would be easier to parse by Octave.  Or figure out a
convenient workaround as there is in this case by including ';' as a literal
and not just as a delimiter. 


    _______________________________________________________

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]