Last active
February 18, 2022 17:31
-
-
Save jlstanus/c3ebef9b5bd7ce15cda7c53031c9e41f to your computer and use it in GitHub Desktop.
This file contains hidden or 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 | |
file = open('excel.md') | |
data = [] | |
for line in file.readlines(): | |
filtered = list(filter(lambda attr: attr not in ['','\n'] , line.split('|'))) | |
trimmed = [attr.strip() for attr in filtered] | |
data.append(trimmed) # provide more general splitter | |
data.remove(data[1]) | |
df = pd.DataFrame(data=data) | |
df.to_excel('sheet.xlsx') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment