Multiple String Manupulations in one node - Calculating lengths


My dataset looks something like this :

id State City      Zip         StreetName

1  MA     boston  01609  mainSt

2  CA     frenso   90706   westpark

I need to calculate lengths of each columns and append to diff columns for each row in table to look like this:

id State City      Zip         StreetName  StateLength CityLength ZipLength StreetLength

1  MA     boston  01609     mainSt              2                       6                  5                          6

2  CA     riverdale 90706   westpark           2                       9                5                        8

I dont want to use multiple "string manupulations" nodes to do this, any neat way of doing this ?


Thanks !




you can loop through the columns

Hi Geo,

 how exactly would I do that  ?

Sorry I'm very new to KNIME, started learning just two weeks back.


-Mohammed Ayub


hmm, if you really only need this for three columns, I suggest you use the three nodes of str manip, for loop on column list is unfortunately not very easy to handle. If there are many more columns, then I'll describe you a possible flow tomorrow.

I think it would be the easiest if we had minLength/maxLength for String columns as an aggregation function (so it could be used in GroupBy for the use case you described). I have checked and it seems it is not part of the base KNIME installation, maybe someone already implemented it though.

Here is an example using the Column List Loop.


Thanks Ferry That helped me !!