I have a json file, it was generated using rest api call as below:
import json
resp = requests.get('https://....offset=0&limit=500&where=....', headers=headers)
json_data = json.loads(resp.text)
with open('strings.json') as f:
d = json.load(f)
print(d)
After reading it in variable d
, I get following structure data:
d = [{}, {}, {},{}]
I want to convert above data structure into following format and store it in json file which is also called as jsonlines https://jsonlines.org/examples/:
required_format = {}{}{}{}
In a way, I want to remove outer square brackets and also space, comma between adjacent dictionaries and then again store it in json or any other file format or even without extension. this file it should have this structure after opening it in the chrome or any other browser.
{}{}{}{}