Skip to content

Instantly share code, notes, and snippets.

@dolmen

dolmen/jsonl

Created Jul 3, 2018
Embed
What would you like to do?
Transform a JSON input containing a single array into the "JSON Lines" format
#!/usr/local/bin/jq -cf
# This script transforms a JSON input containing a single array into the "JSON Lines" format (http://jsonlines.org)
# See https://stackoverflow.com/questions/42178636/how-to-use-jq-to-output-jsonl-one-independent-json-object-per-line
#
# Install:
# - save this file as "jsonl"
# - install jq (https://stedolan.github.io/jq/)
# - chmod u+rx jsonl
#
# Usage:
# jsonl <file.json>
.[]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.