Created
March 13, 2017 21:11
-
-
Save nygeog/ae2856645f64efe487321a089f41b9df to your computer and use it in GitHub Desktop.
Revisions
-
nygeog created this gist
Mar 13, 2017 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,23 @@ import json def oneTest(): return 'so' def openJSON(inFile): with open(inFile) as json_data: data = json.load(json_data) return data def saveJSON(data,ouFile): with open(ouFile, 'w') as outfile: json.dump(data, outfile) def replaceDataset(data,oldTableName,newTableName): data = json.loads(json.dumps(data).replace(oldTableName,newTableName)) return data def openFileReplaceDatasetSave(inFile,ouFile,oldTableName,newTableName): data = replaceDataset( openJSON(inFile) ,oldTableName,newTableName) saveJSON(data,ouFile) return data