Follow up....still problem.
I need to convert a list of strings copied from row values which, when pasted here looks like this
Tcea1 Atp6v1h Oprk1 Rb1cc1 Fam150a
When pasted in the script window it looks like this
Tcea1
Atp6v1h
Oprk1
Rb1cc1
I need code to convert the clipboard contents to this
{Tcea1, Atp6v1h, Oprk1, Rb1cc1, Fam150a}
and this does not work .... {"Tcea1, Atp6v1h, Oprk1, Rb1cc1, Fam150a"}
but this does {"Tcea1", "Atp6v1h", "Oprk1", "Rb1cc1", "Fam150a"}
so.... how can I alter the Get Clipboard command to generate the proper output? or alternatively remove the "" in a subseqent line of code?
thanks for your help.
Jun 2021
Here is my script (based on help from you all!) which works nicely , in this case to select columns "Aasdh,Abca2,Abca7,Abcf1,Abi3" in a data table.
My new problem: When I have a large list of column names in my clipboard, I dont' want to have to type or convert to names separate by columns as shown in t script here. Instead I want the script to use the clipboard directly to select the columns in the data frame.
How can one convert the clipboard list into "Aasdh,Abca2,Abca7,Abcf1,Abi3...." directly within the script?
thanks!
SCRIPT
//with data table where you want to select the columns now open
Names Default To Here( 1 );
dt = currentdatatable();
// Get list of data column names
col_list = dt << Get Column Names( string );
// User specified column names
cc = {Aasdh,Abca2,Abca7,Abcf1,Abi3};
For( i = 1, i <= N Items( cc ), i++,
If( Contains( col_list, Char( cc[i] ) ),
Column( dt, Char( cc[i] ) ) << Set Selected( 1 )
)
);