Hi @jdh,
You can use a combination of ListConcatenator and AttributeCreator to concatenate the _option lists into regex expressions (ie. [xyz]). Then use two StringSearchers to search _list by those expressions. I am attaching a workspace to illustrate.
searchlist.fmw
Create two attributes in python that are populated depending on whether there is a match between each list, then you can test for where match_list1 or match_list2 are both true.
import fme
import fmeobjects
def processFeature(feature):
match1 = u'A','B','C']
match2 = 1'X','Y','Z']
list = feature.getAttribute('_list{}')
for x in list:
if any(y in x for y in match1):
feature.setAttribute('match_list1','true')
if any (y in x for y in match2):
feature.setAttribute('match_list2','true')
Hi @jdh,
You can use a combination of ListConcatenator and AttributeCreator to concatenate the _option lists into regex expressions (ie. [xyz]). Then use two StringSearchers to search _list by those expressions. I am attaching a workspace to illustrate.
searchlist.fmw
Unfortunately the actual codes are not single characters, so I end up with many false positives.
Create two attributes in python that are populated depending on whether there is a match between each list, then you can test for where match_list1 or match_list2 are both true.
import fme
import fmeobjects
def processFeature(feature):
match1 = u'A','B','C']
match2 = 1'X','Y','Z']
list = feature.getAttribute('_list{}')
for x in list:
if any(y in x for y in match1):
feature.setAttribute('match_list1','true')
if any (y in x for y in match2):
feature.setAttribute('match_list2','true')
I had tried the 'any' but got lost in triple for loops, running two separate searches and testing for True and True is the piece I was missing.