Skip to content

Instantly share code, notes, and snippets.

@ammojamo
Created March 7, 2022 11:16
Show Gist options
  • Save ammojamo/b03d48284ad8172aab0bf8cb00657b70 to your computer and use it in GitHub Desktop.
Save ammojamo/b03d48284ad8172aab0bf8cb00657b70 to your computer and use it in GitHub Desktop.
Convert Bionet Species Names to Sqlite
curl https://data.bionet.nsw.gov.au/biosvcapp/odata/SpeciesNames > SpeciesNames.json
cat SpeciesNames.json | jq -r '(.value|map(keys)|add|unique) as $cols | (.value | map(. as $row | $cols | map($row[.]))) as $rows | $cols, $rows[] | @csv' > SpeciesNames.csv
echo '.mode csv
.import SpeciesNames.csv spname' | sqlite3 spname.sqlite
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment