column rename problem

Hi,

I have a workflow that reads in a list of files. I have two files with the same number of columns (two, one String, one Integer) but with different content. One file has a few rows, the other one doesn't have any rows. The type of column is defined by its content and if no content is available it is defined as Int within the KNIME context.  I want to append the two files in loop.

Everything is working fine if both files have at least one row. In the case of one empty file the Loop End node is complaining of different table structures. Since I know the structure for this particular loop I tried to set the type using the Column Rename node. The problem here is that node only shows types that are "applicable" to a given starting column and its values are not strings but rather indices within a list that is created upon input. And that is where my problem is. In case of a integer column (input of a file with no rows) the index is "7" for a stringValue and 1 if the column is actually a string column...

Is there any other way to change the type of a column?

Thanks,

 

Bernd

Hi Bernd,

I think a Java Snippet can easily do this, especially if you do not have to change anything. :) Just return null value there.

Cheers, gabor

PS.: I guess there are easier options too, but this is quite easy too.

Unfortunately a java snipet works on rows. if there are no rows they are not executed.

Actually it seems you are right and I didn't fully understood what you meant...

Sorry for that... You have to replace the column and return col.toString();

Thanks a lot,

 

Bernd