jsawk icon indicating copy to clipboard operation
jsawk copied to clipboard

Unable to parse hyphenated names

Open JamesUoM opened this issue 9 years ago • 3 comments

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

JamesUoM avatar Aug 18 '15 15:08 JamesUoM

+1

ajs124 avatar Sep 24 '15 10:09 ajs124

return this['search-results'].results? Works for me.

cyberhuman avatar Nov 03 '15 05:11 cyberhuman

+1

MdeArcayne avatar Mar 01 '17 12:03 MdeArcayne