spekulatius / jsonl-2-json-files

Converts `jsonl` files into single json files.

Home Page:https://releasecandidate.dev

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

jsonl ➡️json files

Install & Usage

Copy it somewhere.

Usage

Basic usage:

$ ./jsonl-2-json-files
Usage: ./jsonl-2-json-files <output_directory> [jq_selector] [input_file.jsonl]

To generate indexed files (1.json, 2.json, ...):

cat test.jsonl | ./jsonl-2-json-files /tmp/json-files

To use the id field from the JSON as the output filename:

cat test.jsonl | ./jsonl-2-json-files /tmp/json-files '.id'

The script automatically formats the JSON files for improved readability.

Testing

You can test the script by executing the ./test script:

./test

Test completed.

If there is no `git diff` resulting from running this command the scripts work as expected.

About

Converts `jsonl` files into single json files.

https://releasecandidate.dev


Languages

Language:Shell 100.0%