Matching more than one word

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

Moderator: Mr_Noodle

Matching more than one word Sun May 05, 2019 4:07 am • by Rug664
I am creating a rule that will match receipts for my payments. I want to match on who I pay to, sometimes 1 word sometimes 2 or more. How can I match on 1 or more words and then use in renaming it? I can only figure how to match a fixed number of words by adding in the word token.
Rug664
 
Posts: 8
Joined: Sun Aug 18, 2013 7:20 am

Re: Matching more than one word Mon May 06, 2019 10:54 am • by Mr_Noodle
Are there any delimiters either before or after the name you are trying to match? Can you post some examples?
Mr_Noodle
Site Admin
 
Posts: 11195
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Re: Matching more than one word Mon May 06, 2019 6:12 pm • by Rug664
It is just a single line of text at that point like:

Paid To: Some Company Name

So matching "Paid To:" and then multiple words to the EOL is what 'm trying to do.
Rug664
 
Posts: 8
Joined: Sun Aug 18, 2013 7:20 am

Re: Matching more than one word Tue May 07, 2019 10:19 am • by Mr_Noodle
Try "Paid To: (• name)" where (•name) is "anything". It will match until the end of line.
Mr_Noodle
Site Admin
 
Posts: 11195
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Re: Matching more than one word Sun Jul 28, 2019 12:53 am • by Rug664
The trouble seems to be that Hazel has a different idea of what the end of line actually is. In the PDF below I am using "Account name: (• PayTo)" but it matches BSB, not the name. When I select the text in preview it seems that Account Name is in a different area do the name after it, and it will select down to BSB net rather than across. How do I deal with that??

Image
Rug664
 
Posts: 8
Joined: Sun Aug 18, 2013 7:20 am

Re: Matching more than one word Sun Jul 28, 2019 4:12 am • by Robert
A good idea is always to copy the text and paste it in a word processor – showing invisibles you will see how the pdf is really formatted textwise. Then you can see what exactly is before and after the token you are looking for.
"Behind all the inhuman aspects of automation (...) its real possibilities appear: the genesis of a technological world in which man can finally withdraw from (...) the apparatus of his labor – in order to experiment freely with it." /Marcuse
Robert
 
Posts: 52
Joined: Sun Dec 16, 2018 8:05 am

Re: Matching more than one word Tue Jul 30, 2019 6:45 am • by Rug664
I did that and the corresponding part of the PDF looks like this.

Image

So if the document looks in the PDF like the first, but is actually formatted like the second, how can I match the account name to use later if it is munged up like it is?
Rug664
 
Posts: 8
Joined: Sun Aug 18, 2013 7:20 am

Re: Matching more than one word Tue Jul 30, 2019 10:48 am • by Mr_Noodle
You might need to match the last fixed field ("Receipt number:") plus a space plus whatever appears on the lines after it. I'm not sure how predictable that is but it doesn't look like there's much else to go by given how the document is formatted.
Mr_Noodle
Site Admin
 
Posts: 11195
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City


Return to Support

cron