Hi -
I would like to remove columns (based on column names) from a data table that do not match a list. I have following JSL code so far but it is not working.
Input appreciated.
Names Default To Here( 1 );
bigClass = Open( "$SAMPLE_DATA/Big Class.JMP" );
dt = Current Data Table();
col_of_interest = {"name", "age", "weight"};
col_names = dt << Get Column Names( String );
For(j = 1, j <= N Items( col_of_interest ), j++,
For( i = N Items( col_names ), i > 0, i--,
if ( not( col_names[i] == col_of_interest[j],
Remove From( col_names, i ))
);
);
);
dtNew = dt << subset( all rows, columns( col_names ) ); Wait( 0 );