Replace column name IF...

Hi @jarviscampbell

Another user recently experienced something similar. The Column Rename (Regex) is a way to tackle this problem:

With the example that you mentioned, you can use ^(?!.*color).*$ as Regex term and replace it with ‘’‘car’
Dummy input:
image

Column Rename Regex

image
Note: KNIME automatically adds sequential numbers for columns equally named.

For the special characters cleansing, it’s even easier. If you know which chars you expected in your columns, you can clean-up anything that does not meet those requirements.

For example with these headers:
image

Let’s assume that your columns normally only contains letters and numbers, you can use [^A-Za-z0-9] and replace it with a blank or a character of your choice.

Hope this helps!

Edit: If you double stack the above steps and also what @bruno29a rightly points out here then you definitely won’t encounter this issue anymore :wink:

5 Likes