I would like to ask you for help with my json parsing. I've got file where every line looks like this one:
some hexadecimal numbers|something else|int|UA info|{'computer': {'os': {'version': 'blabla', 'name': 'blabla'}, 'app': {'version': 'blabla', 'name': 'blabla'}}}
I've got code which split every line into parts:
for line in some_file:
line2 = line.split('|')
and I wanna to take the last part of each line (which should be in json format, at least i think so) and parse it for future use (I mean that I wanna write (to another file) os=name version, app=name version). I tried something like this:
json_string = json.loads(line2[4])
but python tells me some errors:
Expecting property name: line 1 column 2 (char 1)
or
No JSON object could be decoded
I know that it's something stupid, but i don't know what to do... I would appreciate any advice.