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

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

[Octave-bug-tracker] [bug #54661] textscan() continues from next line if


From: anonymous
Subject: [Octave-bug-tracker] [bug #54661] textscan() continues from next line if line ends with delimiter
Date: Thu, 13 Sep 2018 17:49:07 -0400 (EDT)
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:62.0) Gecko/20100101 Firefox/62.0

URL:
  <https://savannah.gnu.org/bugs/?54661>

                 Summary: textscan() continues from next line if line ends
with delimiter
                 Project: GNU Octave
            Submitted by: None
            Submitted on: Thu 13 Sep 2018 09:49:06 PM UTC
                Category: Octave Function
                Severity: 3 - Normal
                Priority: 5 - Normal
              Item Group: None
                  Status: None
             Assigned to: None
         Originator Name: aj
        Originator Email: 
             Open/Closed: Open
         Discussion Lock: Any
                 Release: 4.4.1
        Operating System: Any

    _______________________________________________________

Details:

Examples are attached - a data file and a script which reads data from that
file using textscan().

When textscan() reads the third line of the example file, it jumps to the
fourth line and basically reads "9,10,NaN,13" instead of interpreting the
third line as "9,10,NaN,NaN" 

If you use textscan to the string '9,10,,' it outputs 9, 10, NaN, NaN which is
logical.


I'm not sure if this is a bug or an intended feature, but it's confusing and
very annoying anyway.

I can't check if Matlab does it this way or not. If it does, then this
behavior shouldn't probably be changed. However, it would be useful if you
could force textscan() to process exactly one line at a time.

Of course you can loop, manually read a line, use textscan(), and merge the
results, but it's much less elegant.



    _______________________________________________________

File Attachments:


-------------------------------------------------------
Date: Thu 13 Sep 2018 09:49:06 PM UTC  Name: bug_example.txt  Size: 35B   By:
None

<http://savannah.gnu.org/bugs/download.php?file_id=45005>
-------------------------------------------------------
Date: Thu 13 Sep 2018 09:49:06 PM UTC  Name: bug_example.m  Size: 181B   By:
None

<http://savannah.gnu.org/bugs/download.php?file_id=45006>

    _______________________________________________________

Reply to this item at:

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

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




reply via email to

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