| View previous topic :: View next topic |
| Author |
Message |
johne Voice
Joined: 19 Jul 2005 Posts: 29
|
Posted: Wed Oct 12, 2011 9:14 pm Post subject: json to nested dict |
|
|
after converting a json feed to tcl dict i'm not able to get the values I need, is this a problem with the json format or something im doing wrong?
http://pastebin.com/19mRWFKZ post json2dict
to get the value im using
dict get $json data game plays play
which returns
| Code: | | {sweater 25 hs 0 aoi {8462042 8467338 8469664 8470151 8470966 8475431} desc {David Moss SHOT on Jaroslav Halak} formalEventId STL54 type Shot eventid 54 hsog 0 asog 1 apb {} p2name {Jaroslav Halak} time 00:26 localtime {1:08 PM} teamid 20 xcoord -53 strength 701 as 0 pid 8469664 period 1 p3name {} hpb {} pid3 {} ycoord 29 playername {David Moss} hoi {8470860 8471348 8471392 8471698 8473485 8473534} p1name {David Moss} pid2 8470860 pid1 8469664} {sweater 5 hs 0 aoi {8466140 8466158 847074.... |
im trying to get the "desc" key "David Moss SHOT on Jaroslav Halak"
any help would be greatly appreciated. |
|
| Back to top |
|
 |
johne Voice
Joined: 19 Jul 2005 Posts: 29
|
Posted: Thu Oct 13, 2011 8:28 am Post subject: |
|
|
<speechl3s> johne --v
<speechl3s> foreach entry [dict get $json data game plays play] {
<speechl3s> dict with entry {
<speechl3s> puts "desc=$desc"
<speechl3s> }
<speechl3s> } |
|
| Back to top |
|
 |
|