cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Try the Materials Informatics Toolkit, which is designed to easily handle SMILES data. This and other helpful add-ins are available in the JMP® Marketplace
newbie_alex
Level III

how to convert column names to a list of strings

Hi,

 

I would like to convert column names to strings but I do not know how.

 

dt = Open( "$SAMPLE_DATA/Decathlon.jmp" );

col_names = dt << Get Column Names();

Show(col_names);

this leads to

col_names = {Name, Country, Score, Name("100m"), Long Jump, Shot Put, High Jump, Name("400m"), Name("100m hurdles"), Discus, Pole Vault, Javelin, Name("1500m")};

I would like to have something like this instead:

col_names = {"Name", "Country", "Score", "100m", "Long Jump", "Shot Put", "High Jump", "400m", "100m hurdles", "Discus", "Pole Vault", "Javelin", "1500m"};

Any idea?

 

Thank you for your help!

 

20 REPLIES 20
pcarroll1
Level IV

Re: how to convert column names to a list of strings

This worked but I needed to first make a group name variable.

j=1;

GN = "ColGroup"||j;

dt << Group Columns(GN, col_list);

worked.

But

dt << Group Columns("ColGroup"||j, col_list);

did not. 

It turned out this was the problem all along.

 

The error message made the problem look like it was with the column list.