I am having a json file like this:
{
"europe": [
"germany",
"france",
...
],
"america": [
"usa",
"canada",
...
]
}
I want to get all items of every prefix like this:
germany
france
usa
canada
I use this:
with open('file.json', 'r', encoding='utf-8') as f:
for object in ijson.items(f, "item"):
print (object)
I tried it with a regular expression that accept every string in front of item
, but it does not work. I think there is a really easy solution I just don't see. Also looked in the documentation of ijson, but didn't find any solution either.
Maybe you can help me.
Greetings