aboutsummaryrefslogtreecommitdiffstats
path: root/ledgerscripts/get_categories.pl
diff options
context:
space:
mode:
authorMatthew Lemon <chaffinach+git@protonmail.ch>2022-04-28 14:23:27 +0100
committerMatthew Lemon <chaffinach+git@protonmail.ch>2022-04-28 14:23:27 +0100
commitc005c07d2b99707fb87b11b27476635015d6d941 (patch)
tree6294f10e583374ad8c89de38f4588d6ac5416915 /ledgerscripts/get_categories.pl
parentef297ce2c65aead25b755f9cc3ed4b8705733299 (diff)
working through ledger scripts
Diffstat (limited to '')
-rw-r--r--ledgerscripts/get_categories.pl4
1 files changed, 4 insertions, 0 deletions
diff --git a/ledgerscripts/get_categories.pl b/ledgerscripts/get_categories.pl
index fc4fa96..554efe6 100644
--- a/ledgerscripts/get_categories.pl
+++ b/ledgerscripts/get_categories.pl
@@ -13,6 +13,10 @@ use warnings;
local $/ = ""; # switch to paragraph mode (allow use of /m modifier below)
while (<>) {
+ # we only want true expenses, no income, rebates, pocket money, etc
+ # Not all undesirable cases will be found based on this so be warned!
+ next if (/Pocket Money|Income|Assets|[Rr]ebate/);
+ next if (/-£/);
if (/\d{4}.*\* (.*)$/m) { print $1 . "@" };
if (/Expenses:(.*)£/) { print $1 . "\n" };
}