Last active
August 17, 2017 14:46
-
-
Save ShaneRich5/d53c90e834dc05cbd49065b10a9bf182 to your computer and use it in GitHub Desktop.
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 characters
import os | |
import json | |
from pprint import pprint | |
for filename in os.listdir('./'): | |
if (filename.endswith('.json')): | |
with open(filename, 'r') as json_file: | |
data = json.load(json_file) | |
if (data['email'] != data['username']): | |
with open(filename, 'w') as json_file: | |
print data['email'] | |
data['username'] = data['email'] | |
json.dump(data, json_file, indent=2, sort_keys=True) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment