import os import json import shutil import copy def process_json_file(file_path): fr = open(file_path, 'r') json_data = json.load(fr) json_data["path"] = "sw" with open(file_path, 'w') as f: json.dump(json_data, f, indent=2) def process_files_in_folder(folder_path): for filename in os.listdir(folder_path): file_path = os.path.join(folder_path, filename) if os.path.isfile(file_path) and filename.endswith('.json'): process_json_file(file_path) if __name__ == "__main__": folder_path = "./peak-perf-allnodes-cpu/" process_files_in_folder(folder_path)