Content matching; Date not matched

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

Moderator: Mr_Noodle

Content matching; Date not matched Tue Dec 17, 2013 8:42 pm • by ScreamingPict
I'm using the content matching on a PDF that has been OCRed.

So I'm trying to Date match on "Date: " followed by a date.

If I just do a custom date match on the date I'm OK, it all works, but that's too general- I don't want it triggering on dates elsewhere.

If I put "Date" followed by the 'Anything' element followed by the same custom date match then it doesn't work.

I selected the text and pasted it into Text Edit and it shows as "Date:21 November 2012"

I ran "mdimport -d2" on the file and it shows the text as "Date: 21 November 2012"

Either of those should work OK with my scheme. Does Hazel not get the same text as mdimport? Is there a way to discern what the text is that Hazel is seeing?

Thanks in advance.
ScreamingPict
 
Posts: 4
Joined: Wed Mar 06, 2013 8:09 am

Re: Content matching; Date not matched Thu Dec 19, 2013 1:54 pm • by Mr_Noodle
The text Hazel gets is slightly different and may be in a different order. If you want to dig into it, you can look in Hazel's bundle for a hazel importer program. Run that on the file (redirect the output to a file as it may not display properly in Terminal) and you can see the text as Hazel would. Or, you can email support and send in the file and I can take a look at it for you.
Mr_Noodle
Site Admin
 
Posts: 11255
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Re: Content matching; Date not matched Fri Dec 20, 2013 5:48 pm • by ScreamingPict
Thanks! That has really helped. I've got my matches working a little better now.

One match that I can't seem to make work is on the text (extracted using Hazel);

Code: Select all
439194 settlements@share.co.uk
15 November 2012 SM


In order to try and match this I use;
Code: Select all
share.co.uk(anything)(Date Match)


And for (Date Match) I use (31)(space)(December)(space)(1999)

Does the (anything) token not match carriage returns?

Thanks in advance. Oh, and Merry Christmas!
ScreamingPict
 
Posts: 4
Joined: Wed Mar 06, 2013 8:09 am

Re: Content matching; Date not matched Mon Dec 23, 2013 3:26 pm • by Mr_Noodle
(anything) does not match line separators as that could result in very bad things (like your whole document sucked into that one variable). A single space will though.
Mr_Noodle
Site Admin
 
Posts: 11255
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Re: Content matching; Date not matched Mon Dec 23, 2013 7:13 pm • by bd_e
Mr_Noodle wrote:If you want to dig into it, you can look in Hazel's bundle for a hazel importer program. Run that on the file (redirect the output to a file as it may not display properly in Terminal) and you can see the text as Hazel would.


I am having a lot of trouble matching dates and other text that should be very simple.

I would like to try looking at Hazel Importer. I found the app in the Hazel package contents.

Can you please explain in more detail how to use it? Specifically, how do I "redirect the output to a file"?

Thank you.
bd_e
 
Posts: 3
Joined: Sun Apr 08, 2012 7:54 pm

Re: Content matching; Date not matched Thu Dec 26, 2013 12:25 pm • by g8orfan
bd_e wrote:
Mr_Noodle wrote:If you want to dig into it, you can look in Hazel's bundle for a hazel importer program. Run that on the file (redirect the output to a file as it may not display properly in Terminal) and you can see the text as Hazel would.


I am having a lot of trouble matching dates and other text that should be very simple.

I would like to try looking at Hazel Importer. I found the app in the Hazel package contents.

Can you please explain in more detail how to use it? Specifically, how do I "redirect the output to a file"?

Thank you.


I'd also a like more detailed explanation on how to use the hazel importer program. This sounds like it will be very helpful in creating and debugging content matching rules.

Thanks
g8orfan
 
Posts: 1
Joined: Thu Dec 26, 2013 11:57 am

Re: Content matching; Date not matched Thu Dec 26, 2013 1:41 pm • by Mr_Noodle
It requires some knowledge of the command line but in short, it should be run as follows:

(path to hazelimporter) (path to the file you want to process) > (path to the file you want to write the output to)

Where you supply the appropriate paths as indicated above. Do not include any of the parentheses.
Mr_Noodle
Site Admin
 
Posts: 11255
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Re: Content matching; Date not matched Wed Jan 22, 2014 7:32 pm • by bd_e
Thank you -- this was helpful. I was able to generate the output file, but I am still having trouble matching.

In this case, the output file includes this section of text:

Page1 of 3
0080 32
$187.95 $190.77

I want to capture the first dollar amount.

I created a custom token with the pattern "(123).(123)". (I'm creating a custom token because I want to use the dollar amount later in the actions that change the file name.)

I created a match for "Contents // contain match // $[custom token]".

When I click the preview eye and then the attributes window, nothing has matched for my custom token.

How can it be that there is no match?
bd_e
 
Posts: 3
Joined: Sun Apr 08, 2012 7:54 pm

Re: Content matching; Date not matched Thu Jan 23, 2014 4:15 pm • by Mr_Noodle
I suggest emailing support. Include your rule as well as a sample file indicating the problem.
Mr_Noodle
Site Admin
 
Posts: 11255
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City


Return to Support