{ "auth": 'log', "appid": 21, "custid": "599c1f910f53ada8468b4567", "hwid": "59e719ba0f53adfd6a8b4597" } 24/10/2017 12:44:24 -------------------------------------------------------------------------------- { "auth": 'log', "appid": 21, "custid": "599c1f910f53ada8468b4567", "hwid": "59e719ba0f53adfd6a8b4597" }
I need to transform a list of jsons delimited by some log lines from a file into a single json . so far i've tried this:
tac tst.txt | sed '/---------/I,+2 d' | tac > out.json
and managed to delete the log lines, but I need to replace them with a comma and add them into a list. How can I do this ? or there is any alternative for this using python ?
'log'
is NOT valid json value. An additional replacement to"log"
should be considered