Share your ideas for the JMP Scripting Unsession at Discovery Summit by September 17th. We hope to see you there!
Choose Language Hide Translation Bar
Highlighted
MathStatChem
Level VI

How can I use recode to prepend a character string to each value?

The situation is that I have a column of sequential values "A", "B", "C", ...  and I want to transform them to "Label A", "Label B", "Label C", ...

3-1-2019 2-12-35 PM.jpg

I know how to do this with a column formula or with JSL, but I was wondering if this is possible with Recode?  Perhaps with using a regular expression?  Any ideas on how to do this with Recode?

 

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted

Re: How can I use recode to prepend a character string to each value?

There is an option in recode under the red triangle menu called "Replace String...". Check the box for regular expression. The regular expression for the position before the first charcter in a string is the ^ (caret). Place ^ in the search text box. Type Label into the replacement text box with a space after the word Label. Click okay and apply the recode. Replace String.PNG

 

-Olivia

View solution in original post

3 REPLIES 3
Highlighted

Re: How can I use recode to prepend a character string to each value?

The Recode command works with the values in a column, not across column headers.

Learn it once, use it forever!
Highlighted

Re: How can I use recode to prepend a character string to each value?

There is an option in recode under the red triangle menu called "Replace String...". Check the box for regular expression. The regular expression for the position before the first charcter in a string is the ^ (caret). Place ^ in the search text box. Type Label into the replacement text box with a space after the word Label. Click okay and apply the recode. Replace String.PNG

 

-Olivia

View solution in original post

Highlighted
MathStatChem
Level VI

Re: How can I use recode to prepend a character string to each value?

Thanks! That's the answer I was looking for.  

Article Labels

    There are no labels assigned to this post.