Created
March 20, 2021 17:57
-
-
Save bmaingret/8943d4eca52f37ab557580303017e8e5 to your computer and use it in GitHub Desktop.
Convert XLSX to CSV supporting multi-line cells
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 pandas as pd | |
infile = pd.read_excel(r'myfile.xlsx') | |
infile = infile.replace(to_replace=[r"\\t|\\n|\\r", "\t|\n|\r"], value=["",""], regex=True) | |
infile.to_csv(r'myfile.csv', index=False, header=True, quoting=csv.QUOTE_ALL) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment