UK-IPOP / drug-extraction

A ToolBox for fuzzily extracting drugs mentions from text.
https://drug-extraction.vercel.app
MIT License
3 stars 0 forks source link

Accept JSON into CLI app #67

Closed nanthony007 closed 2 years ago

nanthony007 commented 2 years ago

It would be great to accept JSON data to the CLI app that way it can be utilized as a step in a pipeline directly as opposed to needing the additional step of CSV preprocessing.

nanthony007 commented 2 years ago

This would add a lot of complexity and so will be closed for now with preference of using this sexy one-liner taken from the inter webs:

Requires jq link

jq --slurp -r '(map(keys) | add | unique) as $cols | map(. as $row | $cols | map($row[.])) as $rows | $cols, $rows[] | @csv'

This can be put into a bash script for automation and file conversion.