I have a table with a column which classifies each row by a string. In a second table I have a mapping of string bands to a super classifier. I need the super classifier in the first table.
Example:. First table contains strings like abc1234de, abc3456ef, abc1245gh
The second table with the super classifier looks like this:
abc12* is mapped to super class A
abc34?6* is mapped to super class B
The super class table uses asterisks ? for one char and * for more characters.
What do you think, is this task feasible in knime? To be honest I haven’t got any solution Idea at all…
I think you can do it with a Recursive Loop node and a String Replacer node with Wildcard pattern. I attached the example workflow below. Hope this helps!
mappingExample.knwf (31.4 KB)
It’s very slow (I have around 1000 patterns to try) but it works. Thanks for sharing.
Try to use Rule Engine (Dictionary) node instead of loop. The first column in a dictionary have to have $class$ LIKE “wildcard string to compare”.
Hm, do you mean, I have to state in the wildcard column ’ $class$ LIKE “wildcard” ’ which means that I have to expand the wildcard column with ’ $class$ LIKE ’ and set the wildcard in quotes?
Yes. It is easy with String Manipulation node.
Wow, this did the trick. It’s much more easy and very fast. Thanks for sharing.