* DONE JSON to a table with jtbl :blog:json: CLOSED: [2020-10-03 Sat 22:10] :LOGBOOK: - State "DONE" from "" [2020-10-03 Sat 22:10] :END: :PROPERTIES: :CREATED: [2020-10-03 Sat 22:10] :ID: 2020-10-03-jtbl :END: [[https://github.com/kellyjonbrazil/jtbl][jtbl]] is a Python programm to convert JSON from STDIN to table. It could be installed via [[https://guix.gnu.org/][GNU Guix package manager]] from =ace3e549= commit. The following example demonstrates =ifconfig= command output converted to JSON with =jc= utility, piped to =jq= to filter, and to =jtbl= generate a table: #+BEGIN_SRC bash ifconfig \ | jc --ifconfig \ | jq --raw-output "[.[] | {\"interface\": .name, \"ipv4_addr\": .ipv4_addr}]" \ | jtbl #+END_SRC #+RESULTS: | interface | ipv4_addr | | --------------- | --------------- | | br-92487ea26a13 | 172.20.0.1 | | br-9a47a96d15a3 | 172.19.0.1 | | br-cf57cf7f08d8 | 172.18.0.1 | | br-fc2bf1eb0e5a | 10.10.100.1 | | docker0 | 172.17.0.1 | | enp6s0 | 192.168.100.120 | | lo | 127.0.0.1 | | tapvpn | 172.16.103.177 |