S5-04
This commit is contained in:
+2
-1
@@ -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='\\'
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user