Automated bank statement filing

From your noodle to other noodles. Talk about ways to get the most from Hazel. Even exchange recipes for the cool rules you've thought up. DO NOT POST YOUR QUESTIONS HERE.

Moderators: Mr_Noodle, Moderators

Automated bank statement filing Fri Sep 07, 2012 4:23 pm • by DBCooper
Hi all,

I just posted an entry on my blog about how to use Hazel to automatically file downloaded bank statements. It uses AppleScript and a call to the command line utilities pdftotext and awk to extract the statement date automatically. I hope someone will find it useful.

http://technosavvy.org/2012/09/07/autom ... ith-hazel/
DBCooper
 
Posts: 20
Joined: Tue Aug 07, 2012 2:37 am

Re: Automated bank statement filing Fri Oct 12, 2012 2:17 am • by JBB
NIce script. I did something similar using csh instead of Applescript (which doesn't support exporting variables to Hazel, so I move/rename within my script). Note that the statement:

/usr/bin/mdimport -d2 [PDF fie] >& [text file]

will also extract the text from a PDF file (and does not require installing different utilities; it comes with OS X).
JBB
 
Posts: 21
Joined: Mon Sep 12, 2011 6:09 pm

Re: Automated bank statement filing Sat Mar 19, 2022 6:40 am • by OjisanSeiuchi
I realize this is an old post, but as of 2022, mdinfo no longer seems to extract useable text from pdf files.

However pdftotext available in the Poppler library works fine. If you have Homebrew installed, it's just:

Code: Select all
brew install poppler
OjisanSeiuchi
 
Posts: 2
Joined: Sat Mar 19, 2022 6:32 am

Re: Automated bank statement filing Thu Sep 21, 2023 10:34 pm • by Trickyt57
The link in this old post no longer works. As of September 2023 it is not necessary to use a script to pull the date from a bank statement. This is how you would get a date from a bank statement and use it as part of the file name:

Image

Note that before the "Date" variable I have put the word "to". This is to distinguish the statement date from all the other dates on the pdf. The bit I want to find is part of this text in red: "From 1 October 2022 to 31 December 2022".

Note that you may need to manaully specify the date format if Hazel does not detect it automatically. This is how you do it (click on the downward pointing arrow after "Date")
Image

Then I rename the file with the date at the front of the file name in the pattern yyyy-mm-dd. You can use a date format which you can manually specify, if you don't like the default format, like this:

Image
Trickyt57
 
Posts: 55
Joined: Tue Sep 18, 2018 12:17 am


Return to Tips & Tricks - DO NOT POST QUESTIONS

cron