hi
I have a config file like this one:
[sectionOne]
key1_1=value1_1
key1_n=value1_n
#this is a comment
[sectionTwo]
key2_1=value2_1
key2_n=value2_n
;this is a comment also
[SectionThree]
key3_1=value3_1
key3_n=value3_n
[SectionFor]
....
I need to translate this into json (and reverse), using minimal shell tools (no perl,python,php, just sed,awk available)
Code:
[
{
"sectionOne": {
"key1_1": "value1_1",
"key1_n": "value1_n"
}
},
{
"sectionTwo": {
"key2_1": "value2_1",
"key2_n": "value2_n"
}
},
{
"sectionThree": {
"key3_1": "value3_1",
"key3_n": "value3_n"
}
}
]
Is it possible?
Any idea would be greatly appreciated
thank you in advance!