Altering text with arbitrary charactersHi, I need to change the name of columns. Specifically, I need to remove any @ followed by arbitrary 6 digit numbers. To make it clear, jhsj@ksjdskj@123456 need to change to jhsj@ksjdskj. There are lots of 6digit numbers and all different. Any idea how I should do this?
This is the piece of code I have so far:
dt = current data table();
colnames = dt << get column names("string");
for(i=1,i<=n items(colnames),i++,
??????????????
);Re: Altering text with arbitrary charactersTry Regex() to find and delete any occurences of "@xxxxxx" in the column names.
dt = Current Data Table();
colnames = dt << get column names("string");
For(i = 1, i <= N Items(colnames), i++,
Column(dt, i) << set name(
Regex(colnames[i], "(.+)@\d{6}(.*)", "\1\2", GLOBALREPLACE)
)
);