cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • Register to attend Discovery Summit 2025 Online: Early Users Edition, Sept. 24-25.
  • New JMP features coming to desktops everywhere this September. Sign up to learn more at jmp.com/launch.
Choose Language Hide Translation Bar
dn610
Level III

Removing Part of a string of variable length

Hi - I'm trying to remove the IDs from the Name column (e.g. C17-2612.4 2612.4, C23, etc.). Can someone help me with the jsl?

 

dn610_0-1742831434753.png

 

1 ACCEPTED SOLUTION

Accepted Solutions
txnelson
Super User

Re: Removing Part of a string of variable length

Here is one approach

Names Default To Here( 1 );
For Each Row(
	name = Substr(
		name,
		Length( Word( 1, name, "ABCDEFGHIJKLMNOPQRSTUVWXYZ" ) ) + 2
	)
);
Jim

View solution in original post

3 REPLIES 3
txnelson
Super User

Re: Removing Part of a string of variable length

Here is one approach

Names Default To Here( 1 );
For Each Row(
	name = Substr(
		name,
		Length( Word( 1, name, "ABCDEFGHIJKLMNOPQRSTUVWXYZ" ) ) + 2
	)
);
Jim
jthi
Super User

Re: Removing Part of a string of variable length

Regex like this might work

Regex(:Name, "C.* ([A-Z].*)", "\1")
-Jarmo
dn610
Level III

Re: Removing Part of a string of variable length

Thank you both! Regex didn't work, but Jim's solution did work. 

Recommended Articles