Tsukihjy's picture
download
raw
630 Bytes
import json
# 输入输出文件名
input_file = 'TCB.json'
output_file = 'filtered_tcb.json'
# 读取 JSON 文件
with open(input_file, 'r', encoding='utf-8') as f:
json_data = json.load(f)
# 提取不含 query_en 和 tcb_id_en 的条目的 tcb_id
result = [
item["tcb_id"]
for item in json_data
if "query_en" not in item and "tcb_id_en" not in item and "tcb_id" in item
]
# 写入结果到输出 JSON 文件
with open(output_file, 'w', encoding='utf-8') as f:
json.dump(result, f, indent=2, ensure_ascii=False)
print(f"共找到 {len(result)} 条结果,已写入 {output_file}")

Xet Storage Details

Size:
630 Bytes
·
Xet hash:
eda0a61439d0f3a88f8276602449633bf0e92963d77aa1510ab61c422358c3b3

Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.