Created
October 28, 2021 23:47
-
-
Save ADelRosarioH/75a7e57efed10807e68ea6704a6576db to your computer and use it in GitHub Desktop.
combine, join or merge a list of excel (xlsx) files into a csv
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 glob | |
import pandas as pd | |
workbooks = glob.glob('*.xlsx') | |
result_df = pd.DataFrame() | |
for wb in workbooks: | |
xlsx = pd.read_excel(wb, engine='openpyxl') | |
result_df = pd.concat([result_df, xlsx]) | |
result_df.to_csv('result.csv', header=True, index=False) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment