How to find several texts in a column

I feel I should know that but I simply cannot find a solution:

I have a table with some search terms. Additionally I have a table with a column with terms that can contain these strings.

2018-11-09%2016_06_44-Mappe4%20-%20Excel

I tried several things like the string manipulation node that only takes “direct input” but not from a table (or txt file) for example.

Yes I could connect several string manipulation nodes after one another but what if I have a list of 50 terms instead of 2? Then it would be cumbersome to delete those nodes or add new ones.

Hopefully I could explain clearly what I wanted to do (find multiple search terms in a data table column).

Thank you in advance for your help!

You could have a look at this example with a loop. There might be other ways to do it. I found that the String Manipulation node and also the Rule engine are somewhat ‘unwilling’ when it comes to using Flow Variables in order to search for substrings so I came up with this solution using a constant value column.

Java Snippet could also be used but we want to keep it ‘KNIME-style’.

Note: if your search terms are very complex and contain special characters the solution to use them als variable names might not work, you might have to adapt the solution.

kn_example_match_serveral_words.knwf (66.3 KB)

thank you very much for the prompt response. I think I will skip this problem for now as the solution is surely working but it’s far beyond my knowledge. I thought there was an easier solution (not saying yours is bad or something similar) like read a “search terms table and iterate through the value column completely for each term”

Again, thank you for your help!

1 Like

You could collect the results in different ways I am sure, it was just to give an example :slight_smile: - my other idea would have been to construct a Regex rule but I have not really gone into that.

1 Like

I’m using the table Indexer Node and the Index Query Node for this…
there I write an OR query such as:
myDocColumn:“Fahrzeuge” OR myDocColumn:“Personen”

1 Like

I now solved it with flow variables.

There’s still manual interaction necessary but I have

  • one Quickform String Input Node that goes into a flow variable and is used as the search term
  • one other Quickform String Input Node that prepares the filename (I wanted results clustered by date and search term)

Not perfect but still works pretty solid.

Thank you @mlauber71 and @adaptagis for answering my question.

2 Likes

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.