What are good CLI tools for JSON?

后端 未结 8 1413
难免孤独
难免孤独 2021-01-30 00:45

General Problem

Though I may be diagnosing the root cause of an event, determining how many users it affected, or distilling timing logs in order to assess the perform

8条回答
  •  天命终不由人
    2021-01-30 01:37

    Recently I discovered that JSON can easily be eval-ed with Python:

    $ python -c "json=eval(open('/json.txt').read()); print len(json['phoneNumber'])"
    2
    

    Though the method will obviously fail if the JSON input contains nulls.

提交回复
热议问题