add another yq example
This commit is contained in:
parent
680c79e030
commit
9481f8ae49
17
README.md
17
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
|
||||
|
Loading…
Reference in New Issue
Block a user