cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Choose Language Hide Translation Bar
weilyne
Level I

Split whole string into 2 new column

table<< New Column("d0", Character, Nominal, Formula(Word(Column(table, "Data"), "_", 1, 3)));
table<< New Column("d1", Character, Nominal, Formula(Word(Column(table, "Data"), "_", 4, 6)));

string= 1_1_1_1_1_1
wanted to split this string into 2 column with data 1_1_1 for d0 and 1_1_1 for d1. Somehow the script above not working

1 REPLY 1
Thierry_S
Super User

Re: Split whole string into 2 new column

Hi,

 

The Word function allows for ranges in the first term. Hence, you can extract the first set of 3 meaningful characters/digits and the last 3 with the formulas below.

Word( [1 3], :Data, "_" );

Word( [4 -1], :Data, "_" );

Note: The Last Word is represented by the "-1" position.

 

Let me know if it works for your needs.

Best,

TS

Thierry R. Sornasse