jsonawk
- awk style json line processor(use js code)
- support awk style: $ BEGIN END
- support loadash: _
installation
npm install -g jsonawk-cli
usage
file.json
{"userid":"001","name":"torvalds"}
{"userid":"002","name":"tj"}
cat file.json | jsonawk 'console.log($.name)'torvaldstj
use lodash
cat file.json | jsonawk 'console.log(_.join([$.name, "making the world better"], " "))'torvalds making the world bettertj making the world better
use BEGIN,END
cat file.json | jsonawk 'BEGIN{var n=0;}{n++;console.log(_.join([$.name, "making the world better"], " ")) }END{console.log(n)}' torvalds making the world bettertj making the world better2
todo
- contact al@xfruit.cn