Created
January 26, 2020 20:17
-
-
Save sam-drew/80d7bc69f56572b1f299698d5481f6e0 to your computer and use it in GitHub Desktop.
Script to merge alphabetically sorted Network Rail locations JSON files.
This file contains hidden or 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
| import glob | |
| import json | |
| result = [] | |
| for file in glob.glob("*.json"): | |
| with open(file, "r") as inputfile: | |
| result.extend(json.load(inputfile)) | |
| with open("TIPLOC_STANOX_LOCs_MERGED.json", "w") as outfile: | |
| json.dump(result, outfile) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment