Magic Pipes
Documentation
Login

mpjson-write

Reads sexprs from standard input and converts them to JSON documents using the medea egg, which are written to standard output. The input sexprs must be of the form medea expects, with all lists being alists that are converted to JSON objects.

Example

$ cat test.csv
Name,Age
Alaric,38
Jean,11
Mary,6
$ mpcsv-read < test.csv | mptable2alist -H | mpjson-write
{"Name":"Alaric","Age":"38"}
{"Name":"Jean","Age":"11"}
{"Name":"Mary","Age":"6"}