Delete all data after space character

HI. I have a Column called SDD. I have the following values:
16AB elephant george
1AB freezer table snow
156AB loyal moose

I’d like to return only characters before the first space:
16AB
1AB
156AB

I am using substring command
substr ($SDD$, 0, indexOf ($SDD$, “ ”) )

Any advice, wise people? KNIME is amazing, I’m a neophyte!

John.,

Try this one

regexReplace($SDD$, “ .*”, “”)

3 Likes

alternatively use cell splitter and filter the results
br

Hmm. I was not able to get regex to work as posted for some reason, but I entered the following code in String Manipulation and it worked! Thank you for the direction!

regexReplace($SSD$, " .*$" ,“”)

hi guys, what if i am trying to delete the characters after the second space?
appreciate your advice.

sample:
FX SPOT CNY
FX FWD AED USD ON
IR CCSW KRW USD 12Y

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