Skip to content

Latest commit

 

History

History
28 lines (23 loc) · 379 Bytes

README.md

File metadata and controls

28 lines (23 loc) · 379 Bytes

Flatten keys and values of a JSON file in a greppable format.

Usage

Usage: flatjson [-q | -Q] [FILE]...
 -q  string are in single quote
 -Q  string are in double quote

Example

flatjson.py <<<'{"key1": "value1",
"key2": [1,5,7],
"key3": {"a": "x", "b": 4}
}'

output:

.key1 = value1
.key2[0] = 1
.key2[1] = 5
.key2[2] = 7
.key3.a = x
.key3.b = 4