Hello, I’m curious how would I move the column header down, making it into a row? I tried to use the extract column header, but after i do not know if i can even add it back as a new row, any ideas oh how i would do it?
thank you very much for your time
Hi @Bleck , yes this is definitely possible. I created a component for this a while ago, when I was regularly copying/pasting data from Knime to a worksheet for some presentation, and could not copy table headers from Knime.
Basically, you separate the table headers and the body using the Extract Column Header, and then just concatenate both:
EDIT: Just to add: The above solution will move the headers to the first row, but the column headers will end up being replaced with generic names (Column 1, Column 2, etc)
Original table:
Results:
If you want to still keep the headers after moving them, you can do it this way:
Results:
Here’s the workflow (I included both ways in my workflow):
Move column header to first row.knwf (15.3 KB)
thank you very much this didnt just solve this problem i was having but 2 more, no joke
thank you once again
@bruno29a 's solution is descriptive and helpful as always and certainly a good option.
Beside this is depends on your data source.
With Excel or Textfiles or Code Snippets you can just uncheck the header option and “demote” the headers when creating your knime table.
br
Hi @Bleck , I created a component for this where you can choose to Copy or Move the headers.
I’ve shared it on the hub as Copy or Move column headers to first row
@takbb , I’ve created an icon for this component thanks to your guide. @ipazin , @ScottF , my first workflow added to the hub
This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.