Hello all,
I have a table where one of the columns had data that is in the form of an alphanumeric string (e.g. 1bc5ef-gh7) and I would like to parse the string using the hyphen as the delimiter and they return the first part of the string (1bc5ef) as data in a new column.
So far, I have the code below. If I use the Words() function, it only returns the second part of the of the string (e.g. gh7). However, if I use the Word() function, the RES list comes up empty.
I would like to get the first part of the string and put it into a new column in the same table.
// there is a data table that already has a column called new_batch
Vals = :new_batch << Get Values; // Get Values out
Res = List(); // Define empty list
For(i = 1 , i <= N Items(Vals), i++,
Test = Words(Vals[i],"-"); // Words is the function that will split your string by delimiter
Insert Into(Res,Test[N Items(Test)]);
);
dt << New Column("new_batch_2", RES);
Any help is appreciated. Thanks,