Created
March 13, 2017 21:11
-
-
Save nygeog/ae2856645f64efe487321a089f41b9df to your computer and use it in GitHub Desktop.
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 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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment