Rearraging tables - some, but not all rows to columns (input from files)

I have multiple files, one column only (no delimiters), each with 0 to 4 (max 6) lines of text.

Using List Files and Loop with File Reader I can read the contents into a table.

Minor Problem: empty files are not read (I have set "Allow short lines" to no avail)

Major Problem:

Each line in the files gives a new row - they need to be in columns instead (not every row a new column though!). Easiest if you have a look at my example table attached.

I tried using CSV Reader instead (new line as delimiter), but that doesn't work in a loop if one has different number of lines. Also had a look at the Ruleset node, but not sure that could do it, nor how to use it properly.

 

Okay, how about this. 

Employ the method used to give the table you got. But before the loop end node, add an  "add empty rows" node and specify in it you need at least one row. Now proceed to give the table you got before, only now you have the empty rows in it as well. 

now use a groupby node. Use the iteration column as the grouping column, and the Col0 column as the aggregator column and aggregate by List.

Now use Split collection column node with "Replace input column " selected.

hope that works for you.

simon.

Thanks, I will try that, hopefully I understand you correctly (could take a while, I sometimes fix workflows within a few hours, sometimes it can take "weeks"...). Stay tuned.

Wow!!!! That worked like a charm! Just had to add a "Split Collection Column" to get separate columns after the "GroupBy"! I enclose the final workflow as pic.

Thanks again, much appreciated!

Great, glad it worked for you. That was an interesting problem to solve. 

I was thinking of a solution from the top of my head, without having knime handy, so glad it worked. 

Simon.