A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/step-/JSON.awk below:

step-/JSON.awk: Practical JSON parser written in awk

A practical JSON parser written in awk.

https://github.com/step-/JSON.awk

JSON.awk is a self-contained, single-file program with no external dependencies. It is similar to JSON.sh, a JSON parser written in Bash -- retrieved on 2013-03-13 to form the basis for JSON.awk. Since then the projects have separated their development paths, each one adding new features that you will not find in the other.

Compatibility with Awk Implementations

Of the many awk implementations around, JSON.awk works better with the POSIX ones and with GNU awk. JSON.awk is routinely tested on Linux with gawk, busybox awk and mawk in this order. I recommend gawk. JSON.awk does not require GNU gawk extensions, and the differences of running gawk with or without the --posix option enabled are minimal, if any. Running with busybox awk requires a simple patch FAQ. Running with mawk requires mawk version 1.3.4 20150503 or higher FAQ.

All OS platforms for which a POSIX awk implementation is available. Special cases:

There is no official conformance test for the JSON language. Thankfully, some unofficial test suites exist. JSON.awk is tested against the JSONTestSuite.

Test results and comparisons

Add files JSON.awk and optionally callbacks.awk to your project and follow the examples.

For full instructions please read the docs. Mawk users please read the FAQ. Busybox awk users also please read the FAQ.

Passing file names as command arguments:

awk -f JSON.awk file1.json [file2.json...]

awk -f JSON.awk - < file.json

cat file.json | awk -f JSON.awk -

Passing file names on stdin:

echo -e "file1.json\nfile2.json" | awk -f JSON.awk

Using callbacks to build a custom application (FAQ 5):

awk -f your-callbacks.awk -f JSON.awk file.json
Projects known to use JSON.awk

This software is available under the following licenses:


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4