Posted to tcl by hypnotoad at Fri Jun 07 01:59:47 GMT 2019view raw
- # Code Snippet
- while {[gets $fin line]>=0} {
- set record(uuid) {}
- set llist [csv::split $line]
- set idx -1
- foreach item $cols {
- set record($item) [lindex $llist [incr idx]]
- puts [list ${item} $record($item)]
- }
- puts [array get record]
- puts [list lookup uuid $record(uuid)]
- if {$record(value) eq {}} continue
- puts "INSERT"
- db eval {insert into main.lookup(uuid,class,subclass,designation,comment,english_display,local_display)
- VALUES
- (:record(uuid),:record(class),:record(subclass),:record(designation),:record(comment),:record(english_display),:record(local_display));
- }
- }
- ###
- # Output
- ###
- basra:build-macos seandeelywoods$ ./wishkit ../data/dcii_isolation.sqlite
- uuid 22a17e6d-784b-4ba3-8aa8-451293077ba3
- class eqpt_system
- subclass {}
- designation 60Hz
- english Electrical
- local Electrical
- comment {}
- subclass {} ÿuuid 22a17e6d-784b-4ba3-8aa8-451293077ba3 designation 60Hz english Electrical class eqpt_system uuid {} comment {} local Electrical
- lookup UUID {}
- can't read "record(value)": no such element in array