Split one row to many rows

Hi,

I have a knime table with one column with content as follows :

product1
product2
product3
product4

but all above four lines are in one row of the knime table

How to split to such knime table from one row to 4 rows ?

Appreciate if anyone can help.

is this what you mean?

column1 column2 column3 column4
product1 product2 product3 product4

transforming to

columnl
product1
product2
product3
product4

if so, you can use an unpivot node. Have a look at the attached workflow, 

David

 

Sorry, maybe my wordings not correct, what I mean is 

Currently, these 4 items are on 1 row

columnl

product1

		<p>product2</p>

		<p>product3</p>

		<p>product4&nbsp;</p>
		</td>
	</tr>
</tbody>

 

I would like to split it into 4 rows as follows:

columnl
product1
product2
product3
product4
 

If I undertand right, you have four items in one cell, and would like to split them into 4 cells  in one column.

How are your items arranged? Is it in a list? or a string?

David

 

nodes you may consider, Cell Splitter and Cell Splitter By Position, Ungroup, and if it's more complicated maybe a java snippet

 

see if this has what you want, I created an excel input where I put four rows in one cell, so it looks like the input you have

It then extracts it using a cell splitter node splitting on \n as the new line character, you need to check use backslash as escape for this to work. Then you can either return the entries as extra columns and unpivot, or return as a list, and ungroup

David

 

1 Like

Got it. Thanks you so much. It works perfectly