Skip to content

Instantly share code, notes, and snippets.

@bovine
Last active January 25, 2018 19:46
Show Gist options
  • Save bovine/56423f4b299205fad16f1b43749de8d6 to your computer and use it in GitHub Desktop.
Save bovine/56423f4b299205fad16f1b43749de8d6 to your computer and use it in GitHub Desktop.
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