Files
jiaowu-test/scripts/split_resume_json.py
KQL 27f2339c9e feat: 添加AI课程集成和修复初始化错误
- 将终生学习系统课添加到公共课直播间
- 修复allCalendarEvents初始化顺序问题
- 更正AI课程导师为李奇
- 添加AI课程与日历页面同步功能
2025-09-07 23:09:48 +08:00

60 lines
2.0 KiB
Python
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import json
import math
# 读取原始的个人简历内容.json
with open('/Users/apple/Documents/cursor/教务系统/frontend/网页未导入数据/个人简历内容.json', 'r', encoding='utf-8') as f:
all_data = json.load(f)
# 计算每个文件应该包含的数据量
total_items = len(all_data)
items_per_file = math.ceil(total_items / 3)
print(f"总共有 {total_items} 个岗位数据")
print(f"每个文件将包含约 {items_per_file} 个岗位")
# 拆分数据
part1 = all_data[:items_per_file]
part2 = all_data[items_per_file:items_per_file*2]
part3 = all_data[items_per_file*2:]
# 保存拆分后的文件
output_dir = '/Users/apple/Documents/cursor/教务系统/frontend/网页未导入数据/'
# 保存第一部分
with open(output_dir + '个人简历内容_part1.json', 'w', encoding='utf-8') as f:
json.dump(part1, f, ensure_ascii=False, indent=2)
print(f"Part 1: 保存了 {len(part1)} 个岗位")
# 保存第二部分
with open(output_dir + '个人简历内容_part2.json', 'w', encoding='utf-8') as f:
json.dump(part2, f, ensure_ascii=False, indent=2)
print(f"Part 2: 保存了 {len(part2)} 个岗位")
# 保存第三部分
with open(output_dir + '个人简历内容_part3.json', 'w', encoding='utf-8') as f:
json.dump(part3, f, ensure_ascii=False, indent=2)
print(f"Part 3: 保存了 {len(part3)} 个岗位")
# 输出每部分包含的岗位名称
print("\n=== Part 1 岗位列表 ===")
for item in part1:
if '❌岗位名称查询' in item:
print(f" - {item['❌岗位名称查询']}")
print("\n=== Part 2 岗位列表 ===")
for item in part2:
if '❌岗位名称查询' in item:
print(f" - {item['❌岗位名称查询']}")
print("\n=== Part 3 岗位列表 ===")
for item in part3:
if '❌岗位名称查询' in item:
print(f" - {item['❌岗位名称查询']}")
print("\n拆分完成已生成3个文件")
print(" - 个人简历内容_part1.json")
print(" - 个人简历内容_part2.json")
print(" - 个人简历内容_part3.json")