cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • JMP 19 is here! See the new features at jmp.com/new.
  • Register to attend Discovery Summit 2025 Online: Early Users Edition, Sept. 24-25.
Choose Language Hide Translation Bar
lisaash
Level I

How do a split a column at the 5th character?

I have a column that I want to split.  e.g 18.45>  or 16.45< I want to make 1 column with the no. & 1 column with the < & >.

2 REPLIES 2
Victor_G
Super User

Re: How do a split a column at the 5th character?

Hi @lisaash,

 

You could use the Recode Data in a Column option to extract segment, or use column formula :

- Settings to extract the value : 

Victor_G_0-1750406301839.png

Or formula : 

Word( [1 5], :Value, "", Unmatched( :Value ) )

- Settings to extract the sign at the end :

Victor_G_1-1750406332638.png

Or formula : 

Word( -1, :Value, "", Unmatched( :Value ) )

 

If your values may have a different format/length, I think a Regex may be a more flexible option.

Please find attached the datatable used for the demonstration, containing the formula described above in the "Value extracted" and "Sign extracted" columns.

 

Hope this answer will help you,

Victor GUILLER

"It is not unusual for a well-designed experiment to analyze itself" (Box, Hunter and Hunter)
jthi
Super User

Re: How do a split a column at the 5th character?

You can use Recode in many different ways to do this (like Victor did demonstrate). If you need first 5 characters and then the last character, you can also create two formula columns

Left(:value, 5)

and

Righ(:value, 1)

jthi_0-1750420737354.png

Or for the number part use formula

Word(1, :Column 1, "<>")

and same right formula for the sign

-Jarmo

Recommended Articles