add another yq example

This commit is contained in:
Balakrishnan Balasubramanian 2022-07-29 23:48:37 -04:00
parent 680c79e030
commit 9481f8ae49

View File

@ -98,7 +98,7 @@ Tips
Needs [yq](https://github.com/mikefarah/yq) and [xsv](https://github.com/burntsushi/xsv) installed 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 .items
| del(.[] | .url) | del(.[] | .url)
| ( | (
@ -109,3 +109,18 @@ Needs [yq](https://github.com/mikefarah/yq) and [xsv](https://github.com/burntsu
] ]
) )
EOM 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