Knime String Manipulation

Hi All,

I am new to Knime and would like to know how to do below string manipulation.

If current field has two words with comma included, then swap the words by removing the comma.

Eg : Cat,Dog → Dog Cat
Apple,Orange → Orange Apple

Use the Cell Splitter with comma as the splitter, then you can combine the columns back together in reverse order just using a + between the 2 columns in either the String, Rule or Column Expression nodes.

4 Likes

Forum String Manipulation.knwf (16.9 KB)

2 Likes

Hi @sindhuk ,

What do you need? Just replace “,” for " " ? Or need to split it to columns?

@iCFO bring a solution to break it as columns, but if you need just change the string/char, you can use string manipulation note and use the function replace to do it… just say: replace($field$,“,”," ")

and replace for the same column.

Is that helps you?

Regards,

Denis

It looked to me like he needed to reverse the order of the comma separated values and add a space between them.

1 Like

Hi @sindhuk
you can use regex for that


br

3 Likes

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