JSON2TSV(1)

NAME
json2tsv - convert JSON to TSV

SYNOPSIS
json2tsv [-n] [-r]

DESCRIPTION
json2tsv reads JSON data from stdin. It outputs each JSON type to a TAB-Separated Value format per line.

The options are as follows:

-n  Show the indices for array types (by default off).

-r  Show all control-characters (by default off).

TAB-SEPARATED VALUE FORMAT
The output format per line is:

    nodename<TAB>type<TAB>value<LF>

Control-characters such as a newline, TAB and backslash (\n, \t and \\) are always escaped in the nodename and value fields. Other control-characters are removed, unless the option -r is set.

The type field is a single byte and can be:

a for array

b for bool

n for number

o for object

s for string

? for null

EXIT STATUS
json2tsv exits with the exit status 0 on success, 1 on a parse error or 2 when out of memory.

SEE ALSO
awk(1), grep(1)

AUTHORS
Hiltjo Posthuma <hiltjo@codemadness.org>

CAVEATS

Characters in object keys such as a dot or brackets are not escaped in the TSV output, this can change the meaning of the nodename field.

The JSON parser handles all valid JSON. It also allows some invalid JSON extensions: it does not do a complete validation on numbers and is not strict with handling unicode input. See also RFC8259 section 9. Parsers.

The maximum depth of objects or arrays is hard-coded to 64 levels deep.