Skip to content

Instantly share code, notes, and snippets.

@bradparker
Created March 3, 2024 02:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bradparker/4e28fc4dbd8646cb0aa9eb4cf7f058e7 to your computer and use it in GitHub Desktop.
Save bradparker/4e28fc4dbd8646cb0aa9eb4cf7f058e7 to your computer and use it in GitHub Desktop.
LibraryThing JSON export to Table
#! /usr/bin/env nix-shell
#! nix-shell -i bash -p jq dasel
jq \
'[.[] | { code: .ddc.code[0], code_description: .ddc.wording | (if . == null then null else (. | join(", ")) end), author: .primaryauthor, title: .title }] | sort_by(.code)' \
< $1 | dasel -r json -w csv
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment