cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • Learn how to build custom Python data connectors and further customize JMP’s Data Connector Framework with the Python Data Connector Demo, available now in the JMP Marketplace!
  • See how to create experiments to support product design and ID useful product features. Register for June 12 webinar, 2pm US Eastern Time.

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