16 lines
445 B
Python
16 lines
445 B
Python
import pandas as pd
|
||
|
||
# 读取Excel文件
|
||
excel_file = pd.ExcelFile('./22163_data.xlsx')
|
||
|
||
# 获取所有sheet名称
|
||
print("所有sheet名称:", excel_file.sheet_names)
|
||
print("\n" + "="*50 + "\n")
|
||
|
||
# 遍历每个sheet,输出内容
|
||
for sheet_name in excel_file.sheet_names:
|
||
print(f"Sheet:{sheet_name}")
|
||
df = pd.read_excel(excel_file, sheet_name=sheet_name)
|
||
print(df.to_csv(sep='\t', na_rep='nan'))
|
||
print("\n" + "="*50 + "\n")
|