Maybe there is an easier way, but I think the variable clip_items in the script below would get you started. This takes each line in the clipboard and looks for a matching column. The rest of the script selects those columns in the data table table. I run this script from a menu as part of an add-in.
names default to here(1);
dt = current data table();
//Get list of columns in clipboard
clip_input = Get Clipboard();
clip = clip_input;
clip_items = {};
done = 0;
for( i = 1, done == 0 & i <= 10000, i++,
show(clip);
If (
N Items(Regex Match(clip,"[\!\r\!\n]")) == 0
,
if(
length(clip) > 0
,
Insert Into( clip_items, clip)
);
done = 1;
,
thisrow = Regex(clip,"(.+?)[\!\r\!\n]","\!\1");
if( length(thisrow) > 0, Insert Into( clip_items, thisrow) ) ;
clip = Regex(clip,"\!\n(.*)","\1");
);
);
if( i > 10000, throw("found more than 10000 variables"));
col_names = dt << Get Column Names( String );
For( i = 1, i <= N Items( col_names ), i++,
if( contains( clip_items, col_names[i] ),
Column( dt, i ) << Set Selected ( 1 );,
Column( dt, i ) << Set Selected( 0 );,
)
);