From ab987e10f154f5536bb8fd936ae0966e909fa969 Mon Sep 17 00:00:00 2001 From: luxagraf Date: Thu, 15 Jun 2023 15:58:59 -0500 Subject: added all my scripts --- schools-checking-importer.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 schools-checking-importer.py (limited to 'schools-checking-importer.py') diff --git a/schools-checking-importer.py b/schools-checking-importer.py new file mode 100644 index 0000000..bae276a --- /dev/null +++ b/schools-checking-importer.py @@ -0,0 +1,12 @@ +import csv +from datetime import datetime +with open('transactions.CSV', newline='') as csvfile: + with open("temp-trans-out.txt", "w") as output: + trans = csv.reader(csvfile, delimiter=',', quotechar='|') + for t in trans: + dt = datetime.strptime(t[0], '%m/%d/%Y') + dt = dt.strftime("%Y-%m-%d") + line = '%s * "%s"\n Assets:SchoolsFirst:Checking %s USD\n Expenses:Food:Groceries -%s USD\n\n' % (dt, t[1], t[5], t[5]) + output.write(line) + output.close() + csvfile.close() -- cgit v1.2.3-70-g09d2