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

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

[Octave-bug-tracker] [bug #34734] problems with latest strread (newlines


From: Kris Thielemans
Subject: [Octave-bug-tracker] [bug #34734] problems with latest strread (newlines, spaces and commas)
Date: Thu, 03 Nov 2011 18:25:06 +0000
User-agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:7.0.1) Gecko/20100101 Firefox/7.0.1

Follow-up Comment #2, bug #34734 (project octave):

Hi

wow, I hadn't seen that thread on the maintainer list. You and Ben certainly
persist in digging into this. I should probably leave this to you therefore.

However, I cannot resist a comment on your comments (sorry!). You say 

_In your final example, "n" is no "record delimiter" as strread reads from a
string, not a text file. _

This is strange as my final example in the post doesn't have any newlines. But
I now think I understand that the last example

octave> [a1,a2]=newstrread("1     2, 3 4",'%f%f','delimiter','t')

is also a consequence of the strdouble bug. I'm guessing that strread
correctly passes the string "1   2,3 4" as the first field to strdouble (as
there are no delimeters in sight), which then makes a mess of it.

So, upshot of all this, I think you correctly zeroed-in on the bug to fix (i.e
the n as delimiter) for strread, and the str2double bug is separate. Note
however that the same "comma" behaviour happens for %d:

octave:5> [a1,a2]=strread('1,2,3 5 6','%d%d')
a1 =

  123
    6

a2 = 5

but maybe you're using str2double before going to int32.

thanks for all the effort!




    _______________________________________________________

Reply to this item at:

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

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




reply via email to

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