From: Harald O. <har...@el...> - 2012-05-02 14:57:19
|
Am 02.05.2012 16:37, schrieb Larry W. Virden: > 1;2;3;4;"a b c > d e f > g h i j > k l m" > > This should be a list of 3 elements {{a b c} {d e f} {g h i} {j k l}} > Instead, what I get is: > 1 2 3 4 {a b cd e fg h i jk l m} IMHO it works quite right and the observed behaviour is correct. As the contents within double-quotes is seen as one element, you get it back as one list element. A recent csv should also preserve the newlines, so you should get: 1 2 3 4 {a b c d e f g h i j k l m} To transform the abc- etc part to a matrix, I would do: % set listIn {1 2 3 4 {a b c d e f g h i j k l m}} % set matrixRaw [lindex $listIn 4] {a b c d e f g h i j k l m} % set matrixOut {} % foreach rowRaw [split $matrixRaw "\n"] { lappend matrixOut [split $rowRaw " "] } % set matrixOut {{abc} {d e f} {g h i j} {k l m}} Hope this helps, Harald |