STRING MANIPULATION

Good morning people, everything fine ?
Below is my table that I have in knime and just below how I would like it to look. Basically I need to turn the columns into lines, and the lines into columns, but there are several values ​​within the same cell that I need to separate and that stay per line.

image
image

Hi @Gabriel2020 ,

I doubt, each line from each row have the values break with return carrier/newline? If yes, you can use the cell split node to break it as columns and then, you can rename the new column as you wish.

Try it and give the result for us, ok? Or better, give us a demo from your wf to see and help you better.

Tks,

Denis

1 Like

Good morning Denis, thanks for helping me once again. I am leaving below the excel of the file.

knime test.xlsx (7.8 KB)

Hi @Gabriel2020 ,

Your example is very different as your excel file, but I have some inputs for you.

image

Your excel have a loto for columns because you use date as columns information. From this example at the print, I change the position from columns to rows.

To solve it, I just use the “Transpose node” to change the pivot. The result is this:

I rename the columns for better understand about the new data as Empresa/Company and Operacao/Operation.

Then, The Row ID received the name from the columns, so I need to bring it as columns values.

Well, soon here, I made it with “Row ID node”, converting and creating new rows ID, setting the information as “Dias” into a new column and reset the rows IDs at the same moment.

With the “Row Filter node”, I delete the first 2 lines because they don’t have value, just a suggestion for columns name, below of it, the real values will stay clean.

Result:

After that, you can filter rows by Operacao to let only rows with values, or remove missing values, or replace missing values with something else.

Well, here the workflow not reseted for your information.

KNIME_project_gabriel.knwf (41.4 KB)

Regards,

Denis

2 Likes

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