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

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

[Octave-bug-tracker] [bug #52479] textscan ignores leading spaces when c


From: Philip Nienhuis
Subject: [Octave-bug-tracker] [bug #52479] textscan ignores leading spaces when creating cell from string/file
Date: Thu, 23 Nov 2017 15:53:43 -0500 (EST)
User-agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:51.0) Gecko/20100101 Firefox/51.0 SeaMonkey/2.48

Follow-up Comment #5, bug #52479 (project octave):

Indeed the plan has always been to morph textscan() into a backend for
strread. In fact I started that soon after Lachlan's binary textscan was
accepted into core Octave but I didn't pursue that due to lack of time, and
didn't pick up again.

At the time I tried to make strread.m as Matlab-compatible as I could; I think
unconditionally removing spaces isn't the right thing to do.


Note that current strread.m can do some things that Matlab's strread nor
Octave&Matlab's textscan can do, i.e., processing cuddling literals; see e.g.,
this strread.m test:

## Allow cuddling %sliteral but warn that it is ambiguous
%!warning <Ambiguous '%s' specifier immediately before literal in column 1>
%! [a, b] = strread ("abcxyz51\nxyz83\n##xyz101", "%s xyz %d");
%! assert (a([1 3]), {"abc"; "##"});
%! assert (isempty (a{2}), true);
%! assert (b, int32([51; 83; 101]));


and I often use that capability so I'd like to keep strread.m somehow.

As to tests, I'm sure there have been tests for binary textscan() but I didn't
see them anymore in the fntests.log


    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?52479>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

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