Tk Library Source Code

Artifact [efd4467f22]
Login

Artifact efd4467f22b3570b60f58bc5eba5c3dff6b797d9:

Attachment "csvtest.tcl" to ticket [2926387fff] added by dvrsn 2010-01-19 04:20:44.
package require csv
package require struct

set filename /tmp/csvtestfile.csv

set orig {
 {a b c}
 {d "e,\ne" f}
}

set testfile [open $filename w]
puts $testfile [csv::joinlist $orig]
close $testfile

set m [struct::matrix]
set f [open $filename]
csv::read2matrix $f $m , auto
close $f
puts [$m serialize]

set q [struct::queue]
set f [open $filename]
csv::read2queue $f $q
close $f
while {[$q size] > 0} {
   puts "rec: [$q get]"
}