解析脚本

This commit is contained in:
hahwu 2024-12-06 17:37:05 +08:00
parent 7e83b531d2
commit 77a09ff15c
2 changed files with 6 additions and 1 deletions

2
conf.bat Normal file
View File

@ -0,0 +1,2 @@
python .\tool\cfg\tool_cfg_txt.py
pause

View File

@ -3,6 +3,7 @@ import json
import openpyxl
current_dir = os.getcwd()
print(current_dir)
# 读取配置文件
with open(os.path.join(current_dir, 'tool/cfg/cfg_txt.json'), 'r', encoding='utf-8-sig') as f:
cfg = json.load(f)
@ -41,4 +42,6 @@ for file_cfg in file_list:
txt_file.write('\t'.join(file_cfg["coloum_type"]) + '\n')
continue
row_data = [str(cell) for cell in row if cell not in fields_to_remove]
txt_file.write('\t'.join(row_data) + '\n')
txt_file.write('\t'.join(row_data) + '\n')
print(f"Converted: {source_file_path} to {target_file_path}")