Wed 19 Jan 2011 12:10:31 PM UTC, comment #11:
Thank you, it makes sense now. PCRE is indeed not installed on my system.
It works fine now - note that MATLAB was also returning a wrong answer with the previous regexp.
|
Wed 19 Jan 2011 09:13:41 AM UTC, comment #10:
I checked in the following changeset:
http://hg.savannah.gnu.org/hgweb/octave/rev/90f8d12f1964
This seems to fix the problem for me, so I'm closing this report.
|
Tue 18 Jan 2011 08:27:19 PM UTC, comment #9:
The tests will succeed if the PCRE library is used for regexps. It fails on my system if the PCRE library is not used.
That difference is not intentional, so we should either fix the uses of regexp in sttread.m to not require PCRE, or we should probably just require PCRE to build Octave. Then at least we would be able to count on a particular set of regexp capabilities being available.
|
Tue 18 Jan 2011 07:54:51 PM UTC, comment #8:
This works for mee with todays TIP
octave:4> t = textscan('aaa.bbb','%s','delimiter','.');
octave:5> t
t =
{
[1,1] =
{
[1,1] = aaa
[2,1] = bbb
}
}
octave:6>
|
Tue 18 Jan 2011 07:30:22 PM UTC, comment #7:
I just checked again that the functions I'm calling from latest Octave dev are the same than here:
http://hg.savannah.gnu.org/hgweb/octave/file/1811f4f8b3b5/scripts/io/strread.m
http://hg.savannah.gnu.org/hgweb/octave/file/1811f4f8b3b5/scripts/io/textscan.m
same for you? All the tests fails with these files...
|
Tue 18 Jan 2011 07:19:56 PM UTC, comment #6:
Ok. for Octave built with sources current 48 yrs ago ...
With Matalb
|
Tue 18 Jan 2011 06:51:59 PM UTC, comment #5:
Thanks for looking into this but I'm really puzzled...
Using the developers sources, nothing works for textscan:
For the example I sent, I get:
are we talking about the same files ?!?
Concerning the output, it's as it should be (a cell array containing a cell array) and matches with MATLAB.
|
Tue 18 Jan 2011 06:16:43 PM UTC, comment #4:
opps ... I attached the same changeset. Try the 3rd attempt.
(file #22441)
|
Tue 18 Jan 2011 06:13:29 PM UTC, comment #3:
If the prior simple change is the correct thing to do, then this second one is a better implementation and includes a new test.
(file #22440)
|
Tue 18 Jan 2011 06:07:59 PM UTC, comment #2:
Unfortunately, using your suggestion the tests for strread and textscan produce failures for me.
Using the developers sources, all tests for strread and textscan pass.
For the original problem
This is parsing the data correctly, but is not returning it in the proper format.
I haven't studied this bug, but the fix might be quite simple. For example, see the attached changeset.
(file #22439)
|
Tue 18 Jan 2011 05:30:05 PM UTC, comment #1:
Actually, I think it's an error in strread.m, following that change:
http://hg.savannah.gnu.org/hgweb/octave/diff/64728cd28d7a/scripts/io/strread.m
I replaced l.191 in latest version with
[~, ~, ~, fmt_words] = regexp (format, '\%\w+');
and the example below now works, as well as all the tests but two (compared to none before).
|
Thu 06 Jan 2011 02:18:37 PM UTC, original submission:
When running
textscan('aaa.bbb','%s','delimiter','.')
in Octave dev, one gets:
error: strread: format does not match data
while one gets the expected answer in MATLAB: {'aaa';'bbb'}
This relates to these:
http://octave.1599824.n4.nabble.com/textscan-wanted-td3002808.html
https://savannah.gnu.org/bugs/index.php?31380
|