[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Octave-bug-tracker] [bug #50485] textscan() behavior incompatible with
From: |
Dan Sebald |
Subject: |
[Octave-bug-tracker] [bug #50485] textscan() behavior incompatible with matlab in case of empty lines |
Date: |
Tue, 21 Nov 2017 16:38:47 -0500 (EST) |
User-agent: |
Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:55.0) Gecko/20100101 Firefox/55.0 |
Follow-up Comment #4, bug #50485 (project octave):
Actually, I think this (#3) may be a different bug, but in the same area of
code. I believe that bug is quite simply relative to the initial bug. It
looks like the scanning routines all do skipping of white space in some form:
textscan::scan_one (delimited_stream& is, const textscan_format_elt& fmt,
octave_value& ov, Array<octave_idx_type> row)
{
skip_whitespace (is);
However, at the instantiation, the default white space includes the \t
character:
textscan::textscan (const std::string& who_arg)
: who (who_arg), buf (), whitespace_table (), delim_table (),
delims (), comment_style (), comment_len (0), comment_char (-2),
buffer_size (0), date_locale (), inf_nan (init_inf_nan ()),
empty_value (numeric_limits<double>::NaN ()), exp_chars ("edED"),
header_lines (0), treat_as_empty (), treat_as_empty_len (0),
whitespace (" \b\t"), eol1 ('\r'), eol2 ('\n'),
return_on_error (1), collect_output (false),
multiple_delims_as_one (false), default_exp (true), lines (0)
{ }
What needs to be done is remove any delimiters from the whitespace string.
That is, if the user selects
'delimiter', sprintf(','))
as you've done, then that character should be subtracted from the string.
We should probably create another bug report for this if there isn't one
already.
_______________________________________________________
Reply to this item at:
<http://savannah.gnu.org/bugs/?50485>
_______________________________________________
Message sent via/by Savannah
http://savannah.gnu.org/