cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Discussions

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

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