Hazel 5 date problems

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

Moderator: Mr_Noodle

Hazel 5 date problems Sat Dec 05, 2020 6:27 pm • by robson
I'm new to Hazel. I have, however, set up a number of sequences that successfully locate, rename, and move statements, with date patterns working correctly.

Now I'm having difficulty with a specific set of statements and Hazel's creative date formatting.

I've put together some images to show the problem, but can't figure out how to link to them. I see from the FAQ that images need to be available on a public server, but that's beyond what my brain can handle right now, since I have been hitting it against a wall for about an hour.

Here's how the files are naming themselves:
Bank name-4378-01-31-account#1.pdf
Bank name-8727-03-account#2.pdf

This is what I want:
Bank name-2020-11-account#1.pdf
Bank name-2020-11-account#2.pdf

The statements have November 2020 as selectable type in the top two lines of the statement. Below that are some code numbers:

for file #1, CNQ70043780111120 KX 0
from which Hazel is obviously picking up "437801" and turning it into a date.

for file #2, ANQ70003872731120 KX 0
from which Hazel is choosing "87273" and turning it into a date.

My rules are:
Name contains (file name as downloaded from the internet--and I have a successful Hazel sequence to find the file, add pdf extension, and move it to a folder of PDFs to be processed--Hazel is performing this correctly and does locate the file)--GREEN
Contents contain (bank name, being picked up correctly)--GREEN
Contents contain (account number, correct)--GREEN
Contents contain match = custom date = December 1999 [format] = rule does not match--RED

If I can get Hazel to find the date, I'm guessing I can get the renaming to work, because I've succeeded with the other accounts.

I have read the FAQs and can't find the "info tab" in Hazel to look from the perspective of the log. I've looked at all the menu items and sub-items. Search in Hazel help doesn't tell me where the info tab is.

I have tried the terminal option of "mdls " and dragging the file in and hitting return, and I get "Permission denied." I have not, to the best of my knowledge, turned Spotlight off, so there shouldn't be an issue in that regard.

???
robson
 
Posts: 5
Joined: Sat Dec 05, 2020 5:07 pm

Re: Hazel 5 date problems Mon Dec 07, 2020 12:23 pm • by Mr_Noodle
Can you post example text? In Hazel's preview, click on the red badge to see the file contents from Hazel's POV.
Mr_Noodle
Site Admin
 
Posts: 11868
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Re: Hazel 5 date problems Mon Dec 07, 2020 12:30 pm • by robson
Sure. For the "month-year" match line, it seems that Hazel is reading:

ab
UBS Financial Services Inc. 225 108th NE
Suite 800
Bellevue WA 9

Which doesn't match what the program is picking up as a year. . . . (The odd sequence from the code.)

Looking at the statement itself, it appears that Hazel is reading the UBS logo as "ab." There is nothing else on the page before the address.
robson
 
Posts: 5
Joined: Sat Dec 05, 2020 5:07 pm

Re: Hazel 5 date problems Mon Dec 07, 2020 12:31 pm • by Mr_Noodle
I'm not seeing any date line. Can you show the exact text Hazel is matching (it should show that in the preview popover window).
Mr_Noodle
Site Admin
 
Posts: 11868
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Re: Hazel 5 date problems Mon Dec 07, 2020 12:44 pm • by robson
If I could send you a screenshot, I would. The text I put in my previous message is what is in the popover window for the X on the month-year date match condition. I don't see any date line, either!
robson
 
Posts: 5
Joined: Sat Dec 05, 2020 5:07 pm

Re: Hazel 5 date problems Tue Dec 08, 2020 11:25 am • by Mr_Noodle
If there is no date line, then there's an issue with the PDF. Are these files OCRed?
Mr_Noodle
Site Admin
 
Posts: 11868
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Re: Hazel 5 date problems Tue Dec 08, 2020 6:35 pm • by robson
The type is selectable, which I usually take as a sign that it's been OCR'd a/k/a the type can be accessed. I appear to be able to copy it (it is highlighted and cmd C), but when I open a TextEdit and cmd V, it pastes the previously copied item.

In an attempt to see whether additional OCR might be required, I pulled it into Adobe Acrobat (full) and asked for OCR. Because of where it came from, it requires a password to access. (I also was unable to extract a page.)

SIGH.
robson
 
Posts: 5
Joined: Sat Dec 05, 2020 5:07 pm

Re: Hazel 5 date problems Tue Dec 08, 2020 9:02 pm • by EdBurke
The type is selectable, which I usually take as a sign that it's been OCR'd


Open the document and do a search for the term in question. If search can't find it, Hazel won't be able to find it either.
EdBurke
 
Posts: 28
Joined: Wed Apr 18, 2012 6:58 am

Re: Hazel 5 date problems Tue Dec 08, 2020 9:34 pm • by robson
In Preview (lowest common denominator program to search in?), a search picks up "November 2020" multiple times, including the incidence I had hoped Hazel would grab--as the first occurrence of the combined term.
robson
 
Posts: 5
Joined: Sat Dec 05, 2020 5:07 pm

Re: Hazel 5 date problems Wed Dec 09, 2020 8:28 am • by EdBurke
Are you sure the date attribute in the Date Match is formatted properly? Based on the date you provided, it should be formatted as below with a space between the month and year.

You state a search finds multiple instances. Have you tried matching different instances?

Image
EdBurke
 
Posts: 28
Joined: Wed Apr 18, 2012 6:58 am

Re: Hazel 5 date problems Wed Dec 09, 2020 11:51 am • by Mr_Noodle
If the text is searchable in Preview, copy all the text and paste it into a text document. Compare it to what Hazel shows in the preview. It should be the same but if not, then there may be an issue.
Mr_Noodle
Site Admin
 
Posts: 11868
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Re: Hazel 5 date problems Sat Dec 12, 2020 6:19 am • by Trickyt57
I think I see the problem. You want to insert the date on your document into the file name.

Either your PDF file is OCR readable, or its not. From what you say, it sounds like it is OCR readable, so lets move on.

Next question: Can Hazel read the relevant text in your PDF? Write a rule such as "Contents - Contain Match - UBS". Now click on the "Preview" button at the top-left of your Hazel window and select the file that should be processed (i.e. your UBS bank statement).
Image

Next, click on the Green tick, or the Red X next to the rule. A small pop-up appears. Click on the three dots in the bottom right corner of the pop-up.
Image

Next scroll down until you find the date that you are interested in. Notice on my statement that the date is preceded by the word "Date".
Image

I will use this word to locate the correct date as follows:

Make a rule such as Contents - Contain match - Date, and click on custom date in the bottom-left of the pop-up..

Image

Uncheck the box "Automatically detect date format", and enter the date format in the correct way. Give it a name in the top box, such as "Statement Date". Remember to leave a space or a dot or a / between the numbers and words to respect the date format. If you have formatted it correctly a green tick should appear next to the rule:
Image

Now you can use the "Statement Date" token to rename your file. In my case I want my file to start with yyyy-mm-dd followed by the name. This is the default pattern (you can change the default pattern), so my next instruction is to use rename to give the file the name I want using the Statement Date:
Image

If you want to upload images to Hazel you can use https://imgbb.com/, and paste the link as BBcode:
Trickyt57
 
Posts: 60
Joined: Tue Sep 18, 2018 12:17 am

Re: Hazel 5 date problems Sat Dec 12, 2020 5:01 pm • by EdBurke
Either your PDF file is OCR readable, or its not.

Not necessarily...

I've had more than one instance when documents OCRed by PDFpenPro appeared to be useable for matching when they actually were not. By copying and pasting text from an OCRed document into a text document, as Mr Noodle suggested, extraneous artifacts may show. These extraneous artifacts can prevent an exact match.
EdBurke
 
Posts: 28
Joined: Wed Apr 18, 2012 6:58 am


Return to Support