cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • Don’t miss your chance to experience Discovery Summit Europe at our best available rate! Early bird registration through 31 Oct.
  • Image to Table JMP extension imports single or batch images as data tables. Useful to extract curves from pictures or convert image data to curve data to use in analyses like Functional Data Explorer. Download and install the extension.

Discussions

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

Concatenate a string to an integer.

Hi. 

I'm trying to create new columns with the same name, but different extension.

 

For example, I'm trying to create column 1 & column 2 &column 3... etc. 

 

Here is what I have: 

 

lista = list(1 , 2, 3 , 4); 



for(i1=1, i1<N Items ( lista)+1, i1++,
 dt_limit << new column (    insert( "condition", char ( lista(i1) )  )    );

);

 

 

it doesn't seem to work, however. It either returns an error or return something like this: " condition (1, 2, 3, 4) " or: "conditionlista"

 

Any guidance is appreciated. 

2 ACCEPTED SOLUTIONS

Accepted Solutions
RA899
Level IV

Re: Concatenate a string to an integer.

I realized I was using () instead of [] for calling the list index. It looks like its working now. 

View solution in original post

txnelson
Super User

Re: Concatenate a string to an integer.

Here are a couple of ways that I typically use

Names Default To Here( 1 );

lista = List( 1, 2, 3, 4 ); 

For( i1 = 1, i1 < N Items( lista ) + 1, i1++,
	dt_limit << New Column( "condition" || " " || Char( lista( i1 ) ) );
);

or

Names Default To Here( 1 );

lista = List( 1, 2, 3, 4 ); 

For each( {member}, lista,
	dt_limit << New Column( "condition" || " " || Char( member ) ) );
);
Jim

View solution in original post

2 REPLIES 2
RA899
Level IV

Re: Concatenate a string to an integer.

I realized I was using () instead of [] for calling the list index. It looks like its working now. 

txnelson
Super User

Re: Concatenate a string to an integer.

Here are a couple of ways that I typically use

Names Default To Here( 1 );

lista = List( 1, 2, 3, 4 ); 

For( i1 = 1, i1 < N Items( lista ) + 1, i1++,
	dt_limit << New Column( "condition" || " " || Char( lista( i1 ) ) );
);

or

Names Default To Here( 1 );

lista = List( 1, 2, 3, 4 ); 

For each( {member}, lista,
	dt_limit << New Column( "condition" || " " || Char( member ) ) );
);
Jim

Recommended Articles