I am trying to write a python code to convert excel file to csv. I am written the following code:
path_to_excel_files = glob.glob('path/to/excel/files/*.xlsx')
for excel in path_to_excel_files:
out = excel.split('.')+'.csv'
df = pd.read_excel(excel)
Now, the problem is that, this works only of the file is in XLSX format. In my case, the folder contains both: XLSX or XLS file and I have to convert it to csv. How can I do it?