Python convert excel file to csv

–1 vote
Can someone share a python code to convert all excel files to a csv file?
Feb 8, 2019 in Python by Namitha
454 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, 2019 by Omkar
• 69,030 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, 2019 in Python by Omkar
• 69,030 points
2,107 views
+1 vote
2 answers

Python: convert txt file to csv format with rows and columns

If there is lots of raw data ...READ MORE

answered Sep 21 in Python by Archies singh
26,810 views
0 votes
2 answers
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
• 57,680 points
623 views
+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, 2019 in Python by Neha
• 330 points

edited Jul 8, 2019 by Kalgi 1,449 views
0 votes
0 answers
+4 votes
6 answers

Lowercase in Python

You can simply the built-in function in ...READ MORE

answered Apr 11, 2018 in Python by hemant
• 5,800 points
1,084 views
+1 vote
2 answers

Python convert extracted excel file to csv

Some services require table data in CSV ...READ MORE

answered Aug 30, 2019 in Python by Mian Tanzeel
3,856 views
+1 vote
2 answers

Python convert XLS and XLSX file to csv

XLSX tables are usually created in MS ...READ MORE

answered Aug 30, 2019 in Python by Mian Tanzeel
10,564 views