Created
November 28, 2018 18:18
-
-
Save joshschmelzle/dc35e3012ffa345f1a792c6f8a4a041b to your computer and use it in GitHub Desktop.
Iterates through ESS accessPoints.json objects and renames APs.
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 | |
json_data = object() | |
with open('accessPoints.json') as f: | |
json_data = json.load(f) | |
x = 1 | |
for i in json_data['accessPoints']: | |
old = i["name"] | |
i["name"] = "AP{}".format(x) | |
new = i["name"] | |
print("old: {} - new: {}".format(old, new)) | |
x = x + 1 | |
with open('accessPoints-resequenced.json', 'w') as outfile: | |
json.dump(json_data, outfile) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment