|
|
|
|
|
by nh23423fefe
82 days ago
|
|
<input.json jq -S -r '(first | keys) , (.[]| [.[]]) | @tsv'
<input.json # redir
jq
-S # sort
-r # raw string out
'
(first | keys) # header
, # comma is generator
(.[] | # loop input array and bind to .
[ # construct array
.[] # with items being the array of values of the bound object
])
| @tsv' # generator binds the above array to . and renders to tsv
|
|
I knew cat was an anti-pattern, but I always thought it was so unreadable to redirect at the end