Custom Tokens search

Get help. Get answers. Let others lend you a hand.

Moderator: Mr_Noodle

Custom Tokens search Sat Aug 10, 2013 3:19 am • by hansvanderdrift
Hi,

This is a two part question.

Part one:

Please see the attached PDF.

https://dl.dropboxusercontent.com/u/58266/rego.pdf

I am having all types of difficulties trying to create custom tokens from the attached file.

I can find the date, but finding the "From: Account:" and the "To: Payee" is proving to be very difficult.

Image

Are you able to make a Custom Match that can pick out these attributes?

I am trying stuff like this:
Image

I am not so interested in the entire name, but I just can seem to pattern match.

PART 2:

If you are able to find them, could you explain how you did it? This seems to be the longest part of rule making, finding the hidden patterns.

Thanks

Hans
hansvanderdrift
 
Posts: 13
Joined: Wed Jul 31, 2013 6:55 am

Re: Custom Tokens search Mon Aug 12, 2013 12:10 pm • by a_freyer
The reason that you are having difficulty matching here is that OCR'd PDFs will often have weird linebreaks or whitespace that separate characters along the grid. What you're going to have to do is output the tokens through applescript, which itself calls a shell script like this:

I did not have any trouble matching your date using the built in date matching.

From Account:

Code: Select all
mdimport -d2 "$1" 2>&1 | grep "kMDItemTextContent" | awk -F " = " '{print $2}' | grep -Eoi "From: .*?BPAY" | sed 's/ BPAY//g; s/From: //g'


To Account:

Code: Select all
mdimport -d2 "$1" 2>&1 | grep "kMDItemTextContent" | awk -F " = " '{print $2}' | grep -Eoi "To: .*?Biller code:" | sed 's/ BPAY//g; s/To: //g;s/Biller code://g'
a_freyer
 
Posts: 631
Joined: Tue Sep 30, 2008 9:21 am
Location: Colorado

Re: Custom Tokens search Mon Aug 12, 2013 3:46 pm • by Mr_Noodle
Unfortunately, the text in this file is not in the order it appears. Is this an OCR or a digitally created document?

In this case, here is an excerpt of the text as Hazel sees it:
Code: Select all
To: Biller code: Reference: Amount $:
Transfer details
Transfer instructions:
Lodgement number:
(FOR ENQUIRIES)
Receipt number:
IMPORTANT INFORMATION
From:
Every Day Account
QLD TRANSPORT REN 8 - Yamaha Rego 48272


Note how scrambled some of the text is. If it is an OCR, you may want to look into having your statements sent electronically as they tend to be more consistent.
Mr_Noodle
Site Admin
 
Posts: 11272
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Re: Custom Tokens search Mon Aug 12, 2013 3:46 pm • by Mr_Noodle
BTW, is there any sensitive info in that document? Keep in mind you are posting to a public forum so if any of this info is sensitive, I recommend taking down the image and the link (and I can take down the quoted text if necessary).
Mr_Noodle
Site Admin
 
Posts: 11272
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City


Return to Support