This commit is contained in:
2026-03-11 16:48:26 +08:00
parent 113decb414
commit 9c5871b518
21 changed files with 611 additions and 47 deletions
+2 -1
View File
@@ -60,7 +60,7 @@ def convert_excel_to_txt(folder_path='.'):
# 导出设置:
# 1. sep='\t' : 使用制表符分隔
# 2. quoting=csv.QUOTE_NONE : 不使用引号包裹字段,也不会把 " 变成 ""
# 2. quoting=csv.QUOTE_NONE + quotechar='\x00' : 不使用引号包裹字段,且 " 按原样输出
# 3. escapechar='\\' : 如果单元格内恰好有 Tab 键,会用反斜杠转义,防止数据列错位
df.to_csv(
output_file,
@@ -69,6 +69,7 @@ def convert_excel_to_txt(folder_path='.'):
header=False,
encoding='utf-8',
quoting=csv.QUOTE_NONE,
quotechar='\x00',
escapechar='\\'
)