Last active
January 25, 2018 19:46
-
-
Save bovine/56423f4b299205fad16f1b43749de8d6 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
bovine@calek:~/>cat foo.tcl | |
package require yajltcl; # available from https://github.com/flightaware/yajl-tcl | |
set json "\{\"update\":23213,\"msg\":\"qwerty\"\}\n\{\"update\":454323,\"msg\":\"asdfg\"\}" | |
foreach line [split $json "\n"] { | |
array set data [yajl::json2dict $line] | |
parray data | |
puts "----" | |
} | |
bovine@calek:~/>tclsh foo.tcl | |
data(msg) = qwerty | |
data(update) = 23213 | |
---- | |
data(msg) = asdfg | |
data(update) = 454323 | |
---- | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment