Created
March 4, 2014 20:33
-
-
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
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
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