From c886511c99692856e54647715312cc396e825fcb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kier=C3=A1n=20Meinhardt?= Date: Wed, 19 Oct 2022 08:56:47 +0200 Subject: [PATCH] feat: json2csv script --- .bin/json2csv.jq | 5 +++++ 1 file changed, 5 insertions(+) create mode 100755 .bin/json2csv.jq diff --git a/.bin/json2csv.jq b/.bin/json2csv.jq new file mode 100755 index 0000000..5291e45 --- /dev/null +++ b/.bin/json2csv.jq @@ -0,0 +1,5 @@ +#!/usr/bin/env -S jq -r -f +(map(keys) | add | unique) as $cols +| map(. as $row | $cols | map($row[.])) as $rows +| $cols, $rows[] +| @csv