Appending a string

Hello,

I need to append a string based on a rule. I want all of my strings to be 5 characters.

Input:

string number
aaa 3
hhh 3
abhag 5
aq 2
p 1

Output:
string
00aaa
00hhh
abhag
000aq
0000p

Is this possible?

Thanks in advance :slight_smile:

@zielinska_km the function should be padLeft in the Column Expressions – KNIME Hub

padLeft(column("column1"),5 ,"0" )

4 Likes

I get error message: Compilation of script failed: Cannot invoke “javax.script.ScriptEngine.eval(String)” because “engine” is null
What should I do?

@zielinska_km check if you have installed the extension and maybe provide a sampel workflow that shows what you are doing. Also make sure you have the latest KNIME version.

Hi @zielinska_km

You can use the String Manipulation node.
image
gr. Hans

3 Likes

I have installed the extension, but I still get the same warning.