I need to transform an array by adding additional objects -
I have:
"user_id":"testuser"
"auth_token":"abcd"
I need:
"key":"user_id"
"value":"testuser"
"key":"auth_token"
"value":"abcd"
I have been using jq but cant figure out how to do it. Do i need to transform this into a multi-dimensional array first?
I have tried multiple jq queries but cant find the most suitable
When i try using jq i get
jq: error: syntax error, unexpected $end, expecting QQSTRING_TEXT or QQSTRING_INTERP_START or QQSTRING_END (Unix shell quoting issues?) at , line 1
jqcomplains it reaches the end of the input while it was reading a string, which wasn't closed with the appropriate quote). I'm not sure whether it's your command or its input that it fails to parse, hard to tell when you didn't provide either. Probably the input though, I think command parsing errors don't follow that format.