I want to incrementally merge multiple json files of similar structure into a single file that already exists.
My code is:
My code is:
import glob read_files = glob.glob("/dbfs/mnt/sourton-house/File*.json") with open("/dbfs/mnt/sourton-house/mergedJsonFile.json", "w") as outfile: outfile.write('{}'.format('\n'.join([open(f, "r").read() for f in read_files])))The problem is that it over-writes mergedJsonFile.json. I want the files to merge into mergedJsonFile.json