Skip to main content

Hello, I'm new to FME and want to work out which transformers can be used for this task. I need to query a text field held in a CSV file against a list of values (text) stored in a separate CSV. If these values are present I would like to add a value of '1' to a new field in the CSV.

I'm sure this is very basic but would be grateful for any assistance!

Chris

I think I understand you want to know if a string contains one or more words from a list?

You can do this with a StringSearcher and a regex like suggested here.

Depending how dynamic this needs to be, I would:

  • Read the list of words in a seperate stream, merge those words to one feature using a Aggregator, Attributes to Concatenate: "words", Seperator Character: "|".
  • Create Regex with an AttributeCreator and concatenated words. (?:^|(?<= ))(@Value(Words))(?:(?= )|$)
  • Merge regex to all string features using a FeatureMerger, requester and supplier = 1 to match all suppliers to all requestors. Regex being the supplier stream.
  • Check for matches using the StringSearcher.

Thank you, Niels - that has done exactly what I needed to do! Much appreciated. Chris


Reply