"read-line-as-list with-delimiter" bug

idevx <[email protected]> Fri, 5 Aug 2005 02:20:34 -0300 (ART)
Newsgroups gmane.comp.breve
Message-ID <[email protected]>
Hi, I've been trying to use the "read-line-as-list
with-delimiter" method of the File class, but it
doesn't seem to work, always giving me empty lists.
"read-line-as-whitespace-delimited-list" on the other
hand seems to work fine (see sample code below).

I'm trying to load a simple csv (comma separated
values) file, that contains two fields per line, a
filename and a number (an int), separated by a comma.
This is basically a "batch" file for a genetic
algoritm simulation, that has a list of xml file names
to load, followed by the number of generations each
simulation (encoded in the xml) is to be run.

Test data file:
sim657.xml,100
sim123.xml,50
sim987.xml,80
...

I can't use spaces as delimiters, since those are
valid filename/path characters, so
"read-line-as-whitespace-delimited-list" is not an
option for me in this case. (It would work on the
sample data file I posted above if I replaced "," with
" ", but if the files have paths or filenames with
spaces it becomes a problem)

Code:
...
        myList (list).
        myFile =3D new File.
        myFile open-for-reading with-file
currentFileName.
        while (!(myFile is-end-of-file)):
        {
            # doesn't work:
            #myList =3D (myFile read-line-as-list
with-delimiter ",").

            # works fine:
            myList =3D (myFile
read-line-as-whitespace-delimited-list).

            print myList{0}, myList{1}.
        }
...

I'm using the latest version of breve (OS X), from the
link posted on this list a couple of weeks ago (it
says version 2.2.1, but I think it is actually 2.3b)

Cheers,
Ignacio


------------
http://www.wirelesshamster.com

__________________________________________________
Correo Yahoo!
Espacio para todos tus mensajes, antivirus y antispam =A1gratis!=20
=A1Abr=ED tu cuenta ya! - http://correo.yahoo.com.ar
_______________________________________________
breve mailing list
[email protected]
http://lists.spiderland.org/mailman/listinfo/breve