[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Octave-bug-tracker] [bug #51231] textscan skips line ending
From: |
Julius Popp |
Subject: |
[Octave-bug-tracker] [bug #51231] textscan skips line ending |
Date: |
Mon, 26 Jun 2017 11:04:02 -0400 (EDT) |
User-agent: |
Mozilla/5.0 (Windows NT 10.0; WOW64; rv:54.0) Gecko/20100101 Firefox/54.0 |
Follow-up Comment #3, bug #51231 (project octave):
Thanks for the explanation, I'll be able to adapt to the current version now.
I'd like to ask about the documentation as I understand it that textscan does
handle lines.
Octave 4.0.3 documentation:
-- Function File: C = textscan (FID, FORMAT, N)
...
"When reading from file, N specifies the number of data lines to read; in this
sense it differs slightly from the format repeat count in strread."
Octave 4.2.1 documentation and
https://octave.sourceforge.io/octave/function/textscan.html:
C = textscan (fid, format, repeat)
...
The optional numeric argument REPEAT can be used for limiting the
number of items read:
...
N
Read until the first of two conditions occurs:
1) the format has been processed N times, or
2) N lines of the input have been processed.
p.s. I do not have easy access to a Matlab system right now.
p.p.s.: I tried to build a workaround which unfortunately does skip empty
lines (worked around that as well):
line = textscan(fid, '%s', 1, "Delimiter", "\r\n");
words = strsplit(line{1}{1}, {" ", "\t"});
_______________________________________________________
Reply to this item at:
<http://savannah.gnu.org/bugs/?51231>
_______________________________________________
Message sent via/by Savannah
http://savannah.gnu.org/