Last active
January 26, 2023 09:58
-
-
Save martinbeentjes/be134561f818ca05c8ada6ac27558e36 to your computer and use it in GitHub Desktop.
Merge json files into one json file
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
import json | |
import glob | |
result = [] | |
for f in glob.glob("*.json"): | |
with open(f, "rb") as infile: | |
result.append(json.load(infile)) | |
with open("merged_file.json", "wb") as outfile: | |
json.dump(result, outfile) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment