Skip to content

Instantly share code, notes, and snippets.

@joshschmelzle
Created November 28, 2018 18:18
Show Gist options
  • Save joshschmelzle/dc35e3012ffa345f1a792c6f8a4a041b to your computer and use it in GitHub Desktop.
Save joshschmelzle/dc35e3012ffa345f1a792c6f8a4a041b to your computer and use it in GitHub Desktop.
Iterates through ESS accessPoints.json objects and renames APs.
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