Adding rows above dataframe

Hello all,

In the company we use Adobe Analytics. It has certain format of tables to import, specifically: it requires double headers and also comment line above the dataset (see sample).
sample.txt (420 Bytes)

I processed the data to upload (from line 4 and data goes down), line 3 is actually headers of last output table in workflow.
Now I’m scratching my head how to add line 1 and 2 above this table and store the file.

concatenate doesn’t work: I tried to split workflow into to streams - 1st with line 1 and 2, 2nd with the table with data. Since headers doesn’t match, I can’t jus append table under

this 1st line which is just in cell [0][0] impact the logic, so I can’t add it as header to the table with data.

If the Python is the only option, will go to try to write the code, but I’m yet quite weak in Python, so failed to design quickly.

Would appreciate advices what else I can try

I solved the problem
Just in case anyone else would bump into the same question: KNIME allows multiple line comments in CSV writer, also it supports tab indents inside the lines.
See image:
1 - first raw contain simple space so the comment (#) does not stcik to the text
2 - to keep both row with column heading I had to separate the heading in comments with tab delimited - simple pressing tab worked
3 - need to clear this box, so to prevent tailing space

Important also is to switch report’s delimiter to tabs (\t) and disable quotation of values

3 Likes

Hi @kalinichenko . Welcome to the KNIME community. It is good to hear that you managed to resolve your problem and thank you for providing detailed information about how you solved it.

As you have mentioned, this may be useful to others who have a similar problem, so please go ahead and mark your second post above as the solution, which will help others find the answer in future.

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