Dynamically merging multiple columns in a table

I have a table where I want to merge multiple columns. The problem is that the list of coulmns that is supposed to be merged is dynamic, so I cant use a simple cascading merge columns node. I am guessing I need to involve a loop here but am not sure how to create a loop that dynamiaclly picks the columns to merge in each iteration. 

In the end I did it with the help of the Column Aggregator node. I specified a regex for the required columns and selected the "unique concat" aggregation. Worked perfectly!