cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
The Discovery Summit 2025 Call for Content is open! Submit an abstract today to present at our premier analytics conference.
Get the free JMP Student Edition for qualified students and instructors at degree granting institutions.
Choose Language Hide Translation Bar
View Original Published Thread

Removing Part of a string of variable length

dn610
Level III

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.