[Cmpl] bug with readcsv

Bastian Dörig Bastian_D at hotmail.de
Mon Apr 22 09:47:36 EDT 2013


Hello,

I've found a bug with readcsv and don't know how to fix it.
I want to import a matrix from a csv file.
The csv file "test.csv":
10;29999
10;299

and my cmpl file is:

parameters:
E[,] := readcsv("test.csv");
echo count(E[,1]);
echo E[1,1];
echo E[1,2];
echo E[2,1];
echo E[2,2];
echo E[3,1];
echo E[3,2];

with the output:
3 (the file contains only 2 rows, here's the first mistake)
10 (correct)
29999 (correct)
9999 (this are the last 4 digits of the last number in the first row)
error (interpreter): file test.cmpl line7: Parameter E[2,2] is not defined
1 (I think this belongs to the error above)
10 (correct)
299 (correct)


to sum up:

10;29999
10;299
is made to
10;29999
9999
10;299

the last digits of a row are put into a new row. If the csv file 
consists of 3 rows, there will be 5 rows after the import. It doesn't 
depend on the length of the rows.


It would be nice if you could help me.

regrads,
Bastian Dörig



More information about the Cmpl mailing list