String Comparison and Extractions

Hi

Need help with String comparison.

i have following 3 tables.

Ask is to compare strings in Table 3 with Strings in Table 1 and 2. If any of the strings from Table 1 and/or 2 matches to Table 3 strings, then create a separate column with matched value from Table 3.

Table- 1
dog
playful cat
fish
funny monkey

Table- 2
Short Tail
long ear
Cat
cute

Table-3
Cat loves dog
Dog is as cute as my cat
Long ear monkey loves playing with fish.
Fishes are cute
dog with short tail goofs around

Any help with this task is appreciated.

thanks

Hi @Br1jesh,

Can you provide an example of what your desired output table would look like?

Table 4
Cat Dog
Dog Cute Cat
Long Ear Monkey Fish
Fishes Cute
Dog Short Tail

Since we are evaluating strings in table 3 which has 5 line items, output column will also have5 line items with above values.

hope this helps.

I think


will work for you. Just look for examples on forum.

1 Like

Not sure how that will work. Do you have a sample flow?

Look here

KNIME_RuleEngineDirectory_Excercise.knwf (27.9 KB)

tried. but only getting if we found a match or not. not finding the strings that matched.

To Get what you need I’d recommend in Group by use List function instead of Max.
Also take in account that KNIME is case sensitive. Also, if you prefer Index function you may not need Rule Engine Dictionary as I assume expressions like Field LIKE “cat” => “cat”

Would you please upload your workflow, so i have a clear idea?

thanks

Here’s an example I came up with:

The only issue is that “fish” doesn’t match “fishes”

3 Likes

I added examples to your WF here.
KNIME_RuleEngineDirectory_Excercise.knwf.knwf (34.4 KB)

1 Like

Hi there @Br1jesh,

take a look at this topic:

You would need to modify workflow a bit but can help.

Br,
Ivan

3 Likes

thanks a lot.

i think your suggestion worked.

it seems there is no one way to answer this question.

it is unfortunate that i can only select one answer as Solution.

thanks.

this is very close to the finished product.

thanks

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