From ebd8ee49a9f43063850e30c745c8cae46ee13de1 Mon Sep 17 00:00:00 2001 From: Kelly Brazil Date: Mon, 27 Jul 2020 10:28:15 -0700 Subject: [PATCH] add key/value info to ini example --- README.md | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 20bfa6cd..7d785751 100644 --- a/README.md +++ b/README.md @@ -1242,7 +1242,7 @@ ifconfig | jc --ifconfig -p # or: jc -p ifconfig } ] ``` -### INI files +### INI and plain key/value pair files ```bash cat example.ini ``` @@ -1281,6 +1281,31 @@ cat example.ini | jc --ini -p } } ``` +```bash +cat keyvalue.txt +``` +``` +# this file contains key/value pairs +name = John Doe +address=555 California Drive +age: 34 +; comments can include # or ; +# delimiter can be = or : +# quoted values have quotation marks stripped by default +# but can be preserved with the -r argument +occupation:"Engineer" +``` +```bash +cat keyvalue.txt | jc --ini -p +``` +```json +{ + "name": "John Doe", + "address": "555 California Drive", + "age": "34", + "occupation": "Engineer" +} +``` ### iptables ```bash iptables --line-numbers -v -L -t nat | jc --iptables -p # or: jc -p iptables --line-numbers -v -L -t nat