string loop

Hi,

I have a column with a, b, c, d values.
How can I generate string like “a+b+c+d” with a loop?

1 Like

Hello @mehrdad_bgh,

you can use the String Manipulation Node and then “JoinSep”.

BR,
Sven

Hi @sven-abx,

It doesn’t work. Can you give me an example workflow ? Or link ?

Thank you

1 Like

Hi @mehrdad_bgh,

it would be much easier if you could proivde the workflow. :wink:

KNIME_String_Join.knwf (6.2 KB)

BR,
Sven

Hello @sven-abx,

First I have ONE column with 4 variables(a,b,c,d) not 4 columns. Second I said with a LOOP.
I want to do it automatically.

Thank you for your time:)

1 Like

Hi @mehrdad_bgh,

so you have one column with values a b c d which are separted by a “,” and you want to replace the “,” with a “+” - then string manipulation with replace().

or do you have numbers and want to calculate a sum?

br, sven

Hi @mehrdad_bgh

did you checked if group by node with concatenate and delimiter setting to ‘+’ can build the string without loop?

BR

Hi @morpheus @sven-abx

This is the column I have:

This is the result I want:

And I WANT TO and I HAVE TO use loops. ok?
abcd is just a sample, what if there are 1000 of rows? I don’t want to join or concatenate them one by one right?

1 Like

Hi @mehrdad_bgh,

this is the column you have and the column you get using GroupBy Node,

This is the result you implicite with your question. If you want to loop over each rows it is your decision but then you have to think about your data and what is the difference between the concatenate and your solution.

BR

2 Likes

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