Skip to content

Instantly share code, notes, and snippets.

@jlstanus
Last active February 18, 2022 17:31
Show Gist options
  • Save jlstanus/c3ebef9b5bd7ce15cda7c53031c9e41f to your computer and use it in GitHub Desktop.
Save jlstanus/c3ebef9b5bd7ce15cda7c53031c9e41f to your computer and use it in GitHub Desktop.
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