Skip to content

Instantly share code, notes, and snippets.

@sam-drew
Created January 26, 2020 20:17
Show Gist options
  • Select an option

  • Save sam-drew/80d7bc69f56572b1f299698d5481f6e0 to your computer and use it in GitHub Desktop.

Select an option

Save sam-drew/80d7bc69f56572b1f299698d5481f6e0 to your computer and use it in GitHub Desktop.
Script to merge alphabetically sorted Network Rail locations JSON files.
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