This requires that the columns of interest are character columns, you have JMP16 and that the columns pass regex "Column \d{2}"
General idea
- Get list of column names
- Build a list of columns names you are interested in by using some filter (I'm using regex)
- Build expression for the formula with the list from 2.
- Use Eval(EvalExpr()) to add it to new column with a formula
Names Default To Here(1);
dt = New Table("Untitled 2",
Add Rows(0),
Compress File When Saved(1),
New Column("Column 1", Character, "Nominal", Set Values({"a"})),
New Column("Column 2", Character, "Nominal", Set Values({"b"})),
New Column("Column 10", Character, "Nominal", Set Values({"c"})),
New Column("Column 11", Character, "Nominal", Set Values({"d"})),
New Column("Column 12", Character, "Nominal", Set Values({"e"}))
);
col_names = dt << Get Column Names(Character, "String");
list_expr = Expr(List());
For Each({col_name}, col_names,
If(!IsMissing(Regex(col_name, "Column \d{2}")),
Insert Into(list_expr, Name Expr(AsColumn(Column(dt, col_name))));
);
);
// show(Name Expr(list_expr));
Eval(EvalExpr(
dt << New Column("PINNAME", Character, Nominal,
Formula(Concat Items(Expr(list_expr), " "))
);
));
-Jarmo