What are good CLI tools for JSON?

后端 未结 8 1216
难免孤独
难免孤独 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:22

    One way you could do is to convert it to XML. Following uses two perl modules (JSON and XML::Simple) to do fly-by conversion:

    cat test.json | perl -MJSON -MXML::Simple -e 'print XMLout(decode_json(do{local$/;<>}),RootName=>"json")'
    

    which for your example json ends up as:

    
      

提交回复
热议问题