Hi,

This is the best I could get from your example:
<hansl>
#single message
sprintf json "{\"status\":\"REQUEST_SUCCEEDED\",\"responseTime\":1103,\"message\":\"No Data Available for Series LEU0254555900 Year: 1950\",\"Results\":{\"series\":[{\"seriesID\":\"LEU0254555900\",\"data\":[]}]}}"

printf "%s\n", json

test = jsonget(json, "$.message")

printf "test = \n %s", test

#multiple message
sprintf json "{\"status\":\"REQUEST_SUCCEEDED\",\"responseTime\":1103,\"messages\":{\"message1\":\"No Data Available for Series LEU0254555900 Year: 1950\",\"message2\":\"No Data Available for Series LEU0254555900 Year: 1951\",\"message3\":\"No Data Available for Series LEU0254555900 Year: 1952\"},\"Results\":{\"series\":[{\"seriesID\":\"LEU0254555900\",\"data\":[]}]}}"

printf "%s\n", json

test1 = jsonget(json, "$.messages.message1")
test2 = jsonget(json, "$.messages.message2")
test3 = jsonget(json, "$.messages.message3")

printf "test = \n %s\n %s\n %s", test1, test2, test3
</hansl>

I don't really know if that was want you wanted, or the array of strings structure in JSON.

Hélio



On Thu, Jul 24, 2014 at 4:58 PM, Logan Kelly <logan.kelly@uwrf.edu> wrote:

Hello

 

The following does not work, and I cannot figure out why

 

OS = WIN 7 64 bit

gretl = cvs build date 2014-07-22

 

sprintf json "{\"status\":\"REQUEST_SUCCEEDED\",\"responseTime\":1103,\"message\":[\"No Data Available for Series LEU0254555900 Year: 1950\",\"No Data Available for Series LEU0254555900 Year: 1951\",\"No Data Available for Series LEU0254555900 Year: 1952\"],\"Results\":{\"series\":[{\"seriesID\":\"LEU0254555900\",\"data\":[]}]}}"

printf "%s\n", json

test = jsonget(json, "$.message")

printf "test = \n %s", test

 

 

When I use http://jsonpath.curiousconcept.com/ to test the path “$.message” it works fine. Note that to past the json string into the pathfinder tool use this string:

 

{"status":"REQUEST_SUCCEEDED","responseTime":1103,"message":["No Data Available for Series LEU0254555900 Year: 1950","No Data Available for Series LEU0254555900 Year: 1951","No Data Available for Series LEU0254555900 Year: 1952"],"Results":{"series":[{"seriesID":"LEU0254555900","data":[]}]}}

 

Thanks


_______________________________________________
Gretl-devel mailing list
Gretl-devel@lists.wfu.edu
http://lists.wfu.edu/mailman/listinfo/gretl-devel