cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • JMP will suspend normal business operations for our Winter Holiday beginning on Wednesday, Dec. 24, 2025, at 5:00 p.m. ET (2:00 p.m. ET for JMP Accounts Receivable).
    Regular business hours will resume at 9:00 a.m. EST on Friday, Jan. 2, 2026.
  • We’re retiring the File Exchange at the end of this year. The JMP Marketplace is now your destination for add-ins and extensions.

Discussions

Solve problems, and share tips and tricks with other JMP users.
Choose Language Hide Translation Bar
Neo
Neo
Level VI

How to concatenate rows in a given column to a string in JSL?

If I have a datatable dt with one column col1 and several rows containing characters e.g. a, b, c, d i.e. one character per row. How do I get a string of the form myString = 'a','b', 'c', 'd' ?

 

If I do this

 

 

x = Associative Array( dt:"col1" ) << Get Keys; show (x);

it gives me

 

 

x = {"a", "b", "c", "d"};

whereas I would like to get a string 

myString = 'a', 'b', 'c', 'd'

to use further in my next line of code.

 

Any directions would be helpful.

 

Thanks.

When it's too good to be true, it's neither
1 ACCEPTED SOLUTION

Accepted Solutions
jthi
Super User

Re: How to concatenate rows in a given column to a string in JSL?

Use Concat Items after you have the list

Names Default To Here(1);

x = {"a", "b", "c", "d"};

my_string = "'" || Concat Items(x, "','") ||"'";

Write(my_string); // 'a','b','c','d'

 

 

 

 

-Jarmo

View solution in original post

1 REPLY 1
jthi
Super User

Re: How to concatenate rows in a given column to a string in JSL?

Use Concat Items after you have the list

Names Default To Here(1);

x = {"a", "b", "c", "d"};

my_string = "'" || Concat Items(x, "','") ||"'";

Write(my_string); // 'a','b','c','d'

 

 

 

 

-Jarmo

Recommended Articles