I am trying a to run a script that uses a regex to find column names and puts them in a list to then stack. I am struggling to get the actual stack part to work and I think it has to do with the list containing strings rather then column names. Is there a way to convert a list strings into column names?
ref = open(dir||datafile);
allColNames = ref << getcolumnnames;
edgeCols = {};
Ncols = N items(allColNames);
for(i = 1, i <= Ncols, i++,
cname = Column(allColNames[i]) << get Name;
if(!Is Missing (regex(cname,"EDGE\d+") ),
insert into(edgeCols,cname);
);
);
edge stack = ref << stack(
columns(EdgeCols),
Source Label Column("Label");
Source Data Column("Data");
Output Table("Stack");
);