Skip to content

spekulatius/jsonl-2-json-files

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

Topics

Resources

Stars

Watchers

Forks

Languages