Cell splitter and combination

Hello I am Alex and really new in using KNIME. it would be awesome if you can help me

row1______ row2 __________________ row3
Mo_1_____ 09419 111 000 Pos 10_____ empty
Mo_1 _____ empty__________________ 09419 222 000 Pos 10
Mo_2 _____ 09419 234 111 Pos 10_____ empty
Mo_2 _____ empty _________________ 09419 456 111 Pos 10

My aim goal is to create a similar cell name of this informations like

row 1 ____________row4
Mo_1 ___________ 09419 111 000 (without Pos 10)
Mo_1 ___________ 09419 222 000 (without Post 10)
Mo_2 ___________ 09419 111 000 (without 234 but adding three zeros)
Mo_2 ___________ 09419 111 000 (without 456 but addubg three zeros)

I hope you can understand my problem?! :smiley:
About a feedback I would be happy

Hi @Alex1990

Welcome to the KNIME Forum. I hope I understand your question well. I am a little bit confused by row1,2,3 where they are used as columns… See this workflow to help you along Cell splitter and combination.knwf (22.3 KB). I think if you use Regular Expression nodes, you probably need less nodes.


Hope this helps. Feel free to ask if you have any questions. Happy KNIMEing.
gr. Hans

1 Like

Hello @HansS,

first of all thank you for your fast response! It helps me very good!
There is just one problem: all products from Mo_1 have three 000 and at Mo_2 are the “zeros” missing.
What I want is, that the three zeros will be add if the product is from Mo_2 (or in general if the “zeros” are missing).

As I understand in your solutions, I will get the zeros at Mo_2 but also another zeros at Mo_1. So I will have double zeros at Mo_1 products?!

Is there an opportunity to change it?

And it would be nice, if you can also tell me, how I can change the name of “row4”

Thank you in advance!!! :slight_smile:

Best regards from Germany

Like in this picture:

Hi @Alex1990

You are right, I made a mistake in my flow. Here is a new and better version. Cell splitter and combination.knwf (37.7 KB).
You can change the column name of row4 in two ways in this workflow. Directly in Column Aggregator node or in the Column Rename node. I provided both in the workflow. Hope this helps.
Gr. Hans

4 Likes

Hi @HansS,

it looks very good! Is there also an opportunity to delete a special amount of numbers from a column?
Like in this picture

Because from Line Mo_2 i dont need the first 22 to numbers. And there is no space between.

Thank you in advance
Br Alex

1 Like

Hi @Alex1990

Glad I could help you out. You can use a String Manipulation node, and then the substr(string,start) option. In case your new_row4_name is an integer, first convert it to a string with the Number to String node.
gr. Hans

1 Like

Hi there,

Can also use string() function in String Manipulation node to avoid using additional node.

Br,
Ivan

4 Likes

hello at all,

WOW!! the String Manipulation is the KEY!!! with the help of it I also could remove the “Rule Engine” for setting the zeros.

I am starting to love KNIME hahaha

First at all thanks for your help. The first big step in my project is solved :slight_smile:

3 Likes

A post was split to a new topic: Column name manipulation

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