Split whole string into 2 new columntable<< 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)));
<BR />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
Automation and ScriptingRe: Split whole string into 2 new columnHi,
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