Creating a condition to match two words from a list

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

Moderator: Mr_Noodle

I would like to create a condition for files that have two words from a list. For example, consider this list.

Alaska
Arizona
California
Colorado

I would like to create a condition that would match a file that has two words from this list. So California and Alaska.pdf would match but the files California.pdf or Alaska and Mexico.pdf would not.

I tried to do this with the rule attached in the picture but it doesn't quite work. Could someone please point me in the right direction? Thanks!

Image

In case the image above doesn't work, it's here - https://ibb.co/d7btP6
Anjadekar
 
Posts: 24
Joined: Sat Jun 03, 2017 4:33 pm

The problem is that a file named "Alaska" for instance would also match that rule. I can't think of any way to do what you want short of enumerating every possible combination, which isn't usually practical. I think you'd have to write a script to check that list.
Mr_Noodle
Site Admin
 
Posts: 11872
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Actually, thinking about it, you could do a variation of your rule.

Instead of "contains", use "contains match". Create a custom attribute, say "•State". In each case, have it match each of the states. In the next group, add a condition like "Name does not contain match •State".

How this works is that the first instance of •State to match will be bound to that state. For instance, if the name has "California" first, then •State will have to match "California" for each usage after that. The above is a bit tricky to grasp but give it a try and post back if you have any problems.

Oh, and check your spelling on "Colorado".
Mr_Noodle
Site Admin
 
Posts: 11872
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Mr_Noodle wrote:Actually, thinking about it, you could do a variation of your rule.

Instead of "contains", use "contains match". Create a custom attribute, say "•State". In each case, have it match each of the states. In the next group, add a condition like "Name does not contain match •State".

How this works is that the first instance of •State to match will be bound to that state. For instance, if the name has "California" first, then •State will have to match "California" for each usage after that. The above is a bit tricky to grasp but give it a try and post back if you have any problems.

Oh, and check your spelling on "Colorado".


Apologies for resurrecting an old thread but I am revisiting my rules after a while and realised that I still haven't gotten around to implementing this as I didn't quite understand what you mean. Could you please explain it in more detail, preferable with screenshots/an example if that is not too much to ask? Thanks!
Anjadekar
 
Posts: 24
Joined: Sat Jun 03, 2017 4:33 pm

Actually, what I posted won't work as it would also match "California and Mexico". I think for something like this, you will need to use custom logic in a script.
Mr_Noodle
Site Admin
 
Posts: 11872
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City


Return to Support