I’m trying to search for a certain list of keywords in column 1 or 2 and compare that to whether they are in columns 3 and 4. Here’s an example table. I’d like to look for the words “car”, “vehicle”, “auto”, not case sensitive, in these fields. The “Desired Result” column shows an example output.
I’m guessing that some version of regular expressions will help me do this, but I have so little experience with KNIME and no experience with regular expressions, so I’m struggling to figure this out. Any suggestions would be greatly appreciated!
Hi,
You could use a Rule Engine node with the LIKE operator.Your rule could look like this:
($title1$ LIKE "*car*" OR $title1$ LIKE "*vehicle*" OR ...) AND ($url1$ LIKE "*car*" OR $url1$ LIKE "*vehicle*" OR ...) => "1 and 2"
($title1$ LIKE "*car*" OR $title1$ LIKE "*vehicle*" OR ...) AND NOT ($url1$ LIKE "*car*" OR $url1$ LIKE "*vehicle*" OR ...) => "1 only"
...
To simplify this, you can use the Rule Engine (Dictionary) node. It allows you to read the rules from a table, so you can generate them automatically and don’t have to enter them by hand.
Kind regards
Alexander
this topic might help. Also includes references to other same/similar topics as well.
Considering you have “no experience with regular expressions and little with KNIME” I don’t think a bit of learning would do any harm Apart from this community KNIME provides lot of resources here: