From e0ebe4d9b37a0c6347eb1cee4233d09862c6827f Mon Sep 17 00:00:00 2001
From: Evan Pratten <evan@ewpratten.com>
Date: Sat, 10 Aug 2024 12:14:30 -0400
Subject: [PATCH] Add a script for reading bank statements

---
 scripts/read-bank-statement | 10 ++++++++++
 1 file changed, 10 insertions(+)
 create mode 100755 scripts/read-bank-statement

diff --git a/scripts/read-bank-statement b/scripts/read-bank-statement
new file mode 100755
index 0000000..7dbbe9f
--- /dev/null
+++ b/scripts/read-bank-statement
@@ -0,0 +1,10 @@
+#! /bin/bash
+set -e
+
+# Ensure there is an argument
+if [ -z "$1" ]; then
+    echo "Usage: $(basename $0) <file.csv>"
+    exit 1
+fi
+
+cat "$1" | jq -cRr 'split(",") | "\(.[2])\t\(.[6])\t\(.[4])"' | tr -d '"' | tail -n +2 | grep -v "PAYMENT - THANK YOU" | column -ts $'\t'