If I get an output from a command that outputs information in the following way:
{"value1":"value2","value3":"value4","value5":10001,"value6":999.99,}
Is there a way to pass that value to grep/awk and have it create a new file that puts the information in to a file with 1 value per line
so ideally the output I would be looking for in the file would read
value1
value2
value3
value4
value5: 10001
value6: 999.99
appreciate any pointers.
The input looks like JSON. If it is you should probably parse it as JSON using an existing library for a language of your choice (I would use Ruby myself).
But if the input format is simple (e.g., the quoted strings don’t contain anything that would warrant complex parsing), you may be able to get away with something simple along the lines of:
(Note that this does not actually do exactly what you want and it breaks if there are commas inside the quoted strings. Modify as necessary if you go down this path.)