jsawk
jsawk copied to clipboard
Unable to parse hyphenated names
eg {"search-results":{"searchTime":"1","total":"326","limit":"100","offset":"0","query":"oc_deleted:false AND oc_latest_version:true","result":[...] } }
~/bin/jsawk 'return this.search-results.results' < ~/a.json
jsawk: js error: ReferenceError: results is not defined
I've tried the usual JS handling of hyphenated words:
return ["this.search-results"] and this.["search-results"] etc without success
+1
return this['search-results'].results? Works for me.
+1