import os
import pandas
import pandas as pd
import os
inputdir=r'C:\xxx\xxx' (文件夹地址)
for parents, dirnames, filenames in os.walk(inputdir):
for filename in filenames:
if 'xlsx' in filename :
df=pd.read_excel(os.path.join(parents,filename), sort=True,index=False,header=None)
df.to_csv(r'C:\xxx\xxx\\' +'xx.csv',index=False,sep=',',encoding='utf-8',header=False,mode='a')
有改进的地方,自己改,大概这个代码(这么简单害我搜半天合并转dataframe再转csv……还好我机智的自己写出来了)