layer2 commit

This commit is contained in:
lzy
2025-05-28 11:00:24 +08:00
parent 6a6b09ae20
commit 9f5318c23d
66 changed files with 286574 additions and 0 deletions

19
layer2/PGEE/code/merge.py Normal file
View File

@@ -0,0 +1,19 @@
import json
def merge_and_renumber_json(file1, file2, output_file):
with open(file1, 'r', encoding='utf-8') as f1:
data1 = json.load(f1)
with open(file2, 'r', encoding='utf-8') as f2:
data2 = json.load(f2)
merged_data = data1 + data2
for new_idx, item in enumerate(merged_data, start=1):
item['idx'] = new_idx
with open(output_file, 'w', encoding='utf-8') as f_out:
json.dump(merged_data, f_out, indent=2, ensure_ascii=False)
print(f"合并完成,输出文件为: {output_file}")
merge_and_renumber_json('/home/ubuntu/50T/fsy/layer2/QA/code/EN-single_select_includes_process.json', '/home/ubuntu/50T/fsy/layer2/QA/code/821_single_select.json', '/home/ubuntu/50T/fsy/layer2/QA/code/merged.json')