cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • New to JMP? Join us Sept. 23-24 for the Early User Edition of Discovery Summit, tailor-made for new users. Register now for free!
  • Your voice matters! Tell us how you prefer to receive JMP updates, so we can tailor our communication to your needs. Take short survey.
  • See how to access JMP Marketplace - and - find, create & share add-ins to extend your JMP. Watch video.

Discussions

Solve problems, and share tips and tricks with other JMP users.
Choose Language Hide Translation Bar
cchueng
Level IV

Extract words from String Column

How do I create an Output1 column to extract all the words starting with "_D" from a column called String1? 

 

String1                                      Output1

PRD_D30405_v1                     D30405

PRD_MH1_D4375                   D4375

FET-D3245_v2_D43453          D43453

BDT_33tr-ge_DT3746_v2       DT3746

2 REPLIES 2
txnelson
Super User

Re: Extract words from String Column

Here is the formula that I used to get your result

txnelson_0-1746239724355.png

 

Word( 1, Substr( :String1, Contains( :String1, "_D" ) + 1 ), "_" )
Jim
jthi
Super User

Re: Extract words from String Column

You can also use Regex. This should work with your examples

Regex(:String1, "_(D[A-Z0-9]+)", "\1");

 

 

-Jarmo

Recommended Articles