Ways to convert an Excel file to CSV file in Python 3

python-ways-to-convert-excel-to-csv-file-python-3-feature-image

In this tutorial, we’re gonna look at 3 ways to convert an Excel file to CSV file in Python 3. With each way, we use one of these module: xlrd, openpyxl and pandas.

Related Posts:
How to read/write CSV files in Python
How to read/write Excel files in Python
Node.js Extract MySQL Data to Excel(.xlsx) File – using exceljs

Convert Excel file to CSV file using xlrd

With this method, we:
– use xlrd module to open and read Excel file
– then use csv module to write and save CSV file

Example code:

Convert Excel file to CSV file using openpyxl

With this method, we:
– use openpyxl module to open and read Excel file
– then use csv module to write and save CSV file

Example code:

Convert Excel file to CSV file using pandas

With this method, we use only one module pandas to read Excel file and write data to CSV file.

Example code:



By grokonez | March 8, 2019.


Related Posts


Got Something To Say:

Your email address will not be published. Required fields are marked *

*