Home

Awesome

There is a tool to convert XML files to intermediate format that allows editing and data extraction to be performed with simple (not XML-aware) tools, such as regular expressions-based grep or sed. It does not solve the general task of transforming XML files, but still allows text handling tools to go farther than in case of direct attempt to use them on XML.

But xml2 is for XML, and somebody may want the similar tool for JSON.

Here there are two main tools plus several supplementrary ones:

Tested with Python 2.6, 2.7 and 3.2.

Example

JSON file

{ "mist": "qua\nlity\n",
  "fist": [],
   "gist": [5,6,"7"],
   "...": null,
   "test":[[[false]]],
   "var":{"lib":{"dpkg":"status"}}
}

Output of json2:

/...=null
/gist/0=5
/gist/1=6
/gist/2="7
/var/lib/dpkg=status
/fist=[]
/test/0/0/0=false
/mist="qua
/mist="lity
/mist="

Rules of the format

Limitations

See also