Picking different column name if it already exists

I know, that there is some pre-existing method which would automatically suggest a different column name, in case the respective output table would already contain such a column. 

E.g. node wants to append column with name 'myColumn', but table already has that column, the method would return something like 'myColumn (#1)' or similar.

I thought it was in DataColumnSpec or -Creator, but I cannot find it. Can someone please enlighten me? :)

Answering my own question:

org.knime.core.data.DataTableSpec.getUniqueColumnName(DataTableSpec, String)



just a addon, if you need more than one you can also use the class UniqueNameGenerator.



Best, Iris

Cool, good to know! Thanks! :)


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