Python convert excel file to csv

0 votes
Can someone share a python code to convert all excel files to a csv file?
Feb 8 in Python by Namitha
37 views

1 answer to this question.

0 votes

Here you go:

import glob 
path_to_excel_files = glob.glob('path/to/excel/files/*.xlsx')
for excel in path_to_excel_files:
 out = excel.split('.')[0]+'.csv'
 df = pd.read_excel(excel)
 df.to_csv(out) 
answered Feb 8 by Omkar
• 67,120 points

Related Questions In Python

0 votes
1 answer

Python convert all sheets of excel to csv

You will have to parse through the ...READ MORE

answered Feb 8 in Python by Omkar
• 67,120 points
49 views
0 votes
1 answer

How to read Excel File in Python

With pandas it is possible to get ...READ MORE

answered Oct 22, 2018 in Python by Priyaj
• 56,160 points
91 views
0 votes
1 answer

Python program to read the excel file which contains more than 65K records

Hi @Rashmi! I read your code and there ...READ MORE

answered Feb 8 in Python by Omkar
• 67,120 points
26 views
0 votes
1 answer
+1 vote
2 answers

how can i count the items in a list?

Syntax :            list. count(value) Code: colors = ['red', 'green', ...READ MORE

answered Jul 6 in Python by Neha
• 330 points

edited Jul 8 by Kalgi 124 views
+4 votes
6 answers
0 votes
1 answer

Python convert extracted excel file to csv

Try the following script: import pandas as pd import ...READ MORE

answered Feb 8 in Python by Omkar
• 67,120 points
180 views
0 votes
1 answer

Python convert XLS and XLSX file to csv

You can't convert the files with both ...READ MORE

answered Feb 8 in Python by Omkar
• 67,120 points
1,245 views