Step 1
You have install Pandas before using it. Eun the following command on the cmd
In case if you get any error regarding missing modules, run the following command
Create a new file as "csvs_to_excel.py" and paste the following code there.
You have install Pandas before using it. Eun the following command on the cmd
python pip install pandasStep 2
In case if you get any error regarding missing modules, run the following command
pip install openpyxl xlsxwriter xlrdStep 3
Create a new file as "csvs_to_excel.py" and paste the following code there.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import glob | |
import pandas as pd | |
extension = 'csv' | |
all_filenames = [i for i in glob.glob('*.{}'.format(extension))] | |
combined_csv = pd.concat([pd.read_csv(f) for f in all_filenames ]) | |
combined_csv.to_excel('combined.xlsx', index=False) |
Comments
Post a Comment