You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

17 lines
496 B
Python

import json
file_path = "/home/aimo/dev/be-ircfa/src/root_cause/boiler_feedwater_pump_turbine.json"
with open(file_path, "r") as f:
data = json.load(f)
for record in data:
if "matrix" in record:
for entry in record["matrix"]:
if "action_to_confirm" in entry:
del entry["action_to_confirm"]
if "recommended_action" in entry:
del entry["recommended_action"]
with open(file_path, "w") as f:
json.dump(data, f, indent=4)