cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Submit your abstract to the call for content for Discovery Summit Americas by April 23. Selected abstracts will be presented at Discovery Summit, Oct. 21- 24.
Discovery is online this week, April 16 and 18. Join us for these exciting interactive sessions.
Choose Language Hide Translation Bar
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.