Rename columns based on original input table

I’m new to KNIME, so apologies for the simple question. I have a workflow that performs a database search constructed based on an input file. The input file looks like this:

Name ID
Apple 1234.5
Orange 1235.6
Banana 1237.8
Pear 1238.9

The database search is performed using the ID, and I organize it using a pivot node, so the output looks something like this:

Row 1234.5 1235.6 1237.8 1238.9
1 1 9 0 1
2 5 2 3 4
3 3 0 0 0
1000000 7 1 0 0

I’d like to replace the column names with the “Names” column in the original input file, creating this:

Row Apple Orange Banana Pear
1 1 9 0 1
2 5 2 3 4
3 3 0 0 0
1000000 7 1 0 0

Since the input is variable and contain tens or hundreds of elements, I’m trying to come up with a generalized solution that passes the names as a variable. Any help would be greatly appreciated - thank you!

This node will convert your headers based on the first input in your post.

3 Likes

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