Skip to content

Instantly share code, notes, and snippets.

@krmaxwell
Created March 4, 2014 20:33
Show Gist options
  • Save krmaxwell/9355034 to your computer and use it in GitHub Desktop.
Save krmaxwell/9355034 to your computer and use it in GitHub Desktop.
Merge all of VCDB data (https://github.com/vz-risk/VCDB) into one big JSON file
import os
import json
import sys
# initialization
directory = sys.argv[1]
dir_list = os.listdir(directory)
vcdb = []
for filename in dir_list:
with open(os.path.join(directory, filename), 'r') as in_file:
vcdb.append(json.load(in_file))
with open(sys.argv[2],'w') as out_file:
json.dump(vcdb, out_file)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment