by codesnik · 5y ago · 0 comments
back in a day I've loaded a lot of data to postgresql and elastic search after preprocessing it with very simple but powerful chain of CSV parsers (I've used CSVfix), jq, sort, grep, etc.
Some tools from the Node.js universe. `npm install $etc`. https://www.npmjs.com/package/ndjson-cli
https://jsonlines.org https://github.com/ndjson/ndjson.github.io/issues/1
My favorite tool in this area is `lnav` (https://lnav.org), a scriptable / chainable mini-ETL with embedded sqlite.
Oh and tiny correction (intended as helpful not nit-picking), the idiom is "back in the day" not "back in a day". :)
It could also be done as a library of adapters. e.x. something like
j ls
Would run “ls”, parse the output, and re-output it as JSON lines.