cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • Sign-in to the JMP Community will be unavailable intermittently Dec. 6-7 due to a system update. Thank you for your understanding!
  • We’re retiring the File Exchange at the end of this year. The JMP Marketplace is now your destination for add-ins and extensions.
  • JMP 19 is here! Learn more about the new features.

Discussions

Solve problems, and share tips and tricks with other JMP users.
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