Page 1 of 1

Date extraction

PostPosted: Sun May 16, 2021 3:15 am
by chrisbunch
I have a monthly bank statement which prints the date as a range in the format "5 April to 4 May 2021". The date I want to capture is "4 May 2021" but all the patterns I have tried return "5 April 2021". How can I persuade Hazel to ignore "5 April to " ?

Chris

Re: Date extraction

PostPosted: Mon May 17, 2021 10:53 am
by Mr_Noodle
Can you post the pattern you are using?

Re: Date extraction

PostPosted: Mon May 17, 2021 11:11 am
by chrisbunch
I have tried a few, including for example:

31...December...1999

to 31 December 1999

...31...December...1999

Automatically detect date format 1st & 2nd occurrences

Re: Date extraction

PostPosted: Tue May 18, 2021 9:53 am
by Mr_Noodle
Can you check to see if the day (31) is underlined or not? If it is underlined, pick the non-underlined one. The underlined version means that the day must have two digits, so for "4", it would expect "04".

Re: Date extraction

PostPosted: Tue May 18, 2021 11:06 am
by chrisbunch
31 is not underlined. (1999 is)

Re: Date extraction

PostPosted: Wed May 19, 2021 10:49 am
by Mr_Noodle
First off, can you try 5.0.7 that was just released? If you still have the problem, report back.

Re: Date extraction

PostPosted: Thu May 20, 2021 6:05 am
by chrisbunch
No change with 5.0.7 unfortunately - at least with the attached pattern.

I am struggling to devise a pattern that will capture "4 May 2021" from "5 April to 4 May 2021'.

Everything I have tried (including matching 1st or 2nd occurrence) captures "5 April 2021".

It was working for many years previously. I think it may have stopped working as intended with Hazel 5.

[img]chrisbunch.uk/docs/ScreenShot2021-05-20@10.31.35.png[/img]

Re: Date extraction

PostPosted: Thu May 20, 2021 9:38 am
by Mr_Noodle
Can you export your rule and email it in, along with a sample document demonstrating the problem? Make sure to black out any personal info.