Skip to content

Instantly share code, notes, and snippets.

@sloanlance
Last active March 22, 2024 18:05
  • Star 79 You must be signed in to star a gist
  • Fork 4 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save sloanlance/c3bf746b6396f60d321f5535e1ced892 to your computer and use it in GitHub Desktop.
jq: JSONL ↔︎ JSON conversion

jq: JSONL ↔︎ JSON conversion

Prerequisites

  • jqhttps://jqlang.github.io/jq/ — "like sed for JSON data"

    There are several options available for installing jq. I prefer to use Homebrew: brew install jq

  1. JSONL → JSON

    jq -s '.' input.jsonl > output.json
  2. JSON → JSONL

    jq -c '.[]' input.json > output.jsonl
@spidy0x0
Copy link

spidy0x0 commented Feb 7, 2022

what's jq and can i install it with pip install jq?

@klein0r
Copy link

klein0r commented Mar 17, 2022

@ten0hira
Copy link

what's jq and can i install it with pip install jq?
install using: sudo apt install jq

@frfernandezdev
Copy link

🫶

@delano
Copy link

delano commented Mar 22, 2024

Legend

@sloanlance
Copy link
Author

sloanlance commented Mar 22, 2024 via email

@sloanlance
Copy link
Author

sloanlance commented Mar 22, 2024 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment