Am a beginner in Knime.
I want to combine Adult_income data set (41 columns) in file-A and column header information in file-B to a single file. file-B is in columnar format - that is 1 column multiple (41) rows.
What I have done is
1. Read file-B (Column headers file) using CSV Reader node
2. Transpose file-B to get 1 row, 41 columns file using transpose node. But the output has column headers as Row0, Row1.. Row40 etc.
3. Use extract column header to convert and take output from port1 to get a row of data where column names are Col0, Col1,, Col40
4. Read file-A (data file) using CSV reader node.
5. Use Concatenate node to combine output of step 3 (Port 1, not Port 0) and step 4. (This steps add the data header names as the first row from step-3, followed by rows from step4.
6. Use CSV Writer node to write output of step 5 as file-C (Data and header combined)
7 Subsequently read file-C using CSV reader, enabling 'Has Row Header'
Is there a better way to achieve this inKnime?