Hi,
I am trying to rename multiple column header name that consists a particular string but rename it with the existing string while remove the front portion of the string.
Example:
ABC_12::ABCD_AB_ABCDEF_A_ABCDE_X_X_A1_1234_ABCD_TESTING_AB_TEST_ABCD_TESTED_AB_A1 --> TESTING_AB_TEST_ABCD_TESTED_AB_A1
The number of character on the first part of the string (orange) will always be consistent, the 2nd portion of the string will vary from 1 to another.
What have i done so far is the below:
dt=current data table();
colList = dt << get column names( string );
For( i = 1, i <= N Items( colList ), i++,
If( Left( colList[i], 50 ) == "ABC_12::ABCD_AB_ABCDEF_A_ABCDE_X_X_A1_1234_ABCD",
Column( dt, colList[i] ) << Substr((colList[i],50) ), // this is the part where i m stuck.
)
);
I have tried using Trim & Left. But it does not work. I have an idea of using "set name" to take in string after the 50th character. But must have a better way on doing this.