Skip to content

Instantly share code, notes, and snippets.

View Jeffrey04's full-sized avatar
🏳️‍🌈
Learning rust

Choon-Siang Lai Jeffrey04

🏳️‍🌈
Learning rust
View GitHub Profile
@sigma23
sigma23 / covert_json_array_to_jsonlines_jq_or_python.txt
Last active May 15, 2023 19:22
Convert from json array to jsonlines using jq and python
# Run this from the bash command prompt. Make sure that jq is installed https://github.com/stedolan/jq/wiki/Installation
# json_temp.json has the file in the form [{...}, {...}, {...}] and coverts to {...}\n{...}\n
jq -c '.[]' json_temp.json > json_temp.jsonl
# From within python can do this:
pip install jsonlines
import json
import jsonlines