This commit is contained in:
hahwu 2024-12-06 17:48:53 +08:00
parent 77a09ff15c
commit 9296e0c03f

View File

@ -28,19 +28,18 @@ for file_cfg in file_list:
# 将数据写入TXT文件
with open(target_file_path, 'w', encoding='utf-8') as txt_file:
header = [str(cell.value) for cell in sheet[1] if cell.value not in fields_to_remove]
txt_file.write('#\t 界面配置表\n')
i = 0
for row in sheet.iter_rows(values_only=True):
i += 1
if i < 4 :
if i < 3 :
txt_file.write('#\t')
else:
txt_file.write('\t')
if i == 2:
txt_file.write('\t'.join(file_cfg["coloum_type"]) + '\n')
continue
txt_file.write('#\t')
row_data = [str(cell) for cell in row if cell not in fields_to_remove]
txt_file.write('\t'.join(row_data) + '\n')