Regex Column Name replace

 

So i have a mapping of column names contained in two columns, Col1 and Col2. The mapping is not complete as only a few columns are to be renamed

 I feed my master data file through a Column Name (Regex) node which is controlled by variables from a Table Row to Variable Loop Start node. This takes the mapping file as input to control the SearchString and the ReplaceString in the Regex node. The workflow is completed with a Loop end.

I get the following error when I run the workflow

"Execute failed: Input table's structure differs from reference"

  Where have i goofed?  i'm using Knime 2.8.2

 

           Thanks!

                           John

               

 

 

 

When a loop end node completes, each iteration must have the same number of columns and column names, hence in your case it fails.

i am not totally sure what you are trying to do. But I will try and guess.

i suspect you may need to upgrade to knime 2.9 or later first.

then after the variable loop start use a column filter node, and filter the columns by RegEx using one of your variables. This leaves just the columns to be renamed. Then use the column rename regex, and then use loop end (column append) node.

i hope that gets close to what you want. 

Simon.

Hi Simon,

            Thank you very much for this. It worked for me in 2.8.2, although I did get a load of additional columns that I had to filter out.

                             John

 

Yes, the extra coolumns are from not being able to do a Column Filter by RegeX, if I recall this only came in, in KNIME 2.9.

Simon.