From 9481f8ae49d9b335c6324b7a7bed9903d27af8f3 Mon Sep 17 00:00:00 2001 From: balki <3070606-balki@users.noreply.gitlab.com> Date: Fri, 29 Jul 2022 23:48:37 -0400 Subject: [PATCH] add another yq example --- README.md | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index c92e4b2..0cd72b2 100644 --- a/README.md +++ b/README.md @@ -98,7 +98,7 @@ Tips Needs [yq](https://github.com/mikefarah/yq) and [xsv](https://github.com/burntsushi/xsv) installed - yq --from-file /dev/fd/7 ./db.json -o csv 7<<'EOM' | xsv table + yq --from-file /dev/fd/7 db.json -o csv 7<<'EOM' | xsv table .items | del(.[] | .url) | ( @@ -109,3 +109,18 @@ Needs [yq](https://github.com/mikefarah/yq) and [xsv](https://github.com/burntsu ] ) EOM + + yq --from-file /dev/fd/7 db.json -o csv 7<<'EOM' | head | xsv table + .items + | with(.[]; + del(.url), + .title |= sub("\n", ""), + .status |= sub("Done", "✓"), + .status |= sub("Error", "✗"), + .file_name |= sub("^$", "MISSING") + ) + | ( + [ .[0] | keys ] + + [ .[] | [.*] ] + ) + EOM