Skip to content

Instantly share code, notes, and snippets.

@david-botelho-mariano
Created November 18, 2024 14:07
Show Gist options
  • Save david-botelho-mariano/1096183d9eea53f1017c9ad62f2a16f3 to your computer and use it in GitHub Desktop.
Save david-botelho-mariano/1096183d9eea53f1017c9ad62f2a16f3 to your computer and use it in GitHub Desktop.
privy table to css
import csv
with open("summary.txt", 'r') as file:
lines = file.readlines()
with open("summary.csv", 'w', newline='', encoding='utf-8') as csvfile:
csv_writer = csv.writer(csvfile)
for line in lines:
try:
line_array = line.split("│")
line_array.pop(0)
line_array.pop(-1)
stripped_line_array = [s.strip() for s in line_array]
csv_writer.writerow(stripped_line_array)
except Exception as e:
pass
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment