Created
July 3, 2018 16:13
-
-
Save dolmen/3f606509b156ca4ce1b29f56abe98606 to your computer and use it in GitHub Desktop.
Transform a JSON input containing a single array into the "JSON Lines" format
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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