Insert blank rows between existing rows based on cell text.

New to Knime and was wondering how to insert blank rows based on cell value from an existing Excel file, I have created a sorter. In excel I have created a program button to do this. Stumped on how to do this in Knime. Any help would greatly be appreciated.

Example if excel sheet Cell c2 through C6 would have “giant”. Cell C7 through C8 would have “mini”. Cell C9 through C16 would have “small” . And so on. Goal is to insert blank rows between each change in size. Is it possible?

Thanks Bill

Hey and welcome to the forum,

great that you want to use KNIME to move away from Excel :+1:

Not entirely sure I understand though - do you want to insert an empty cell after every group?

E.g.
1 giant
2 giant
3 mini
4 mini
5 mini
6 small

to:

1 giant
2 giant
3 blank
4 mini
5 mini
6 mini
7 blank
8 small

Might be worthwhile for you to upload a simple example in an excel file showing initial input and desired output.

1 Like

Thanks Martin. Yes that is exactly what I am trying to achieve.

Got it.

Here is a prototype:

blankrow.knwf (80.0 KB)

This will work on the assumption that the sizes will not repeat… i.e. in your example mini is only the first 4 rows and mini does not appear again further down in the table.

The workflow iterates over the different groups of sizes and then inside the loop “flips” the table 90 degrees moving row indexes to columns and column names to row indexes. Then a column “Blank” is added before it is flipped again to return to original column names and with one additional row (blank column from before) at the bottom.

5 Likes

That looks like it is exactly what I need to use as an example. I don’t think I would have ever figure it that way. Many thanks!

2 Likes

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