bugGNU Octave - Bugs: bug #58079, textscan goes past EOL when fmt...

 
 

bug #58079: textscan goes past EOL when fmt contains multiple items but input does not

Submitter:  Rik <rik5>
Submitted:  Mon 30 Mar 2020 01:37:49 AM UTC
   
 
Category:  Octave Function Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Matlab Compatibility
Status:  Confirmed Assigned to:  None
Originator Name:  Open/Closed:  * Open
Release:  * dev Operating System:  * Any
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Post a Comment

Add a New Comment Rich Markup
   

Discussion

Mon 30 Mar 2020 01:37:49 AM UTC, original submission:  

Sample code


C = textscan(sprintf ('one\ntwo\nthree\nfour\n'), '%s %s')


In Matlab, C{1} contains "one", "two", "three", "four", and C{2} contains four "" entries.

In Octave, the newline gets eaten and the the second '%s' format takes the next string.


C =
{
  [1,1] =
  {
    [1,1] = one
    [2,1] = three
  }

  [1,2] =
  {
    [1,1] = two
    [2,1] = four
  }

}



Rik <rik5>
Group administrator

 

Attached Files

This item currently has no attached files.

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

Attach Files:
   
   
Comment:
   

 

Dependencies

This item does not depend on any other items.

No items depend on this one.

 

Mail Notification Carbon-Copy List

Carbon-Copy List
  • -email is unavailable- added by efferre79
  • -email is unavailable- added by rik5 (Submitted the item)
  •  

    Votes

    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.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

    History

    Follows 1 latest change.

    Date Changed by Updated Field Previous Value => Replaced by
    2021-01-09 efferre79 Carbon-Copy- Added efferre79

    Back to the top

    Powered by Savane 3.16-a7ba.
    Corresponding source code