translate cfg text file to json and json2text
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:
[ Any idea would be greatly appreciated thank you in advance! |
It seems that to determine the json lines to output from a line in the input you need to consider what are the contents of the previous (or none) and next (or none) line(s) of that input line.
This can be done with awk. |
All times are GMT -5. The time now is 01:04 AM. |