1import pandas as pd
2data_xls = pd.read_excel('excelfile.xlsx', 'Sheet2', dtype=str, index_col=None)
3data_xls.to_csv('csvfile.csv', encoding='utf-8', index=False)
4
1import pandas as pd
2import os
3import glob
4
5
6source="D:\\source\\"
7dest='D:\\dest\\'
8os.chdir(source)
9
10for file in glob.glob("*.xls"):
11 df = pd.read_excel(file)
12 df.to_csv(dest+file+'.csv', index=False)
13 os.remove(file)
14for file in glob.glob("*.xlsx"):
15 df = pd.read_excel(file)
16 df.to_csv(dest+file+'.csv', index=False)
17 os.remove(file)