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.
See how to use JMP Live to centralize and share reports within groups. Webinar with Q&A April 4, 2pm ET.
Choose Language Hide Translation Bar
View Original Published Thread

Extract a value from text

swiergi11
Level III

Hi,

Is it possible to extract the 550 value from the text below using JMP formula that i could then imbedded into script. The over all shape and number of characters will change but the expression of std Pli = will stay the same.

Any help would be greatly appreciated.

 

Thanks,

Tomasz

 

PP, PPr (don’t forget to measure standard wafer SMM PPr WAL S0782-3, "Redarect PPr new" recipe (On WE9LDIP ONLY)) and UVX all (redirect), and run on click vale for mismatch info, Final PP
std Pli = 550 average value1 = … (Run/Std = >5.00) 100 / 120 = 0.8333
DOD tap and bottom on monitor only.

3 REPLIES 3


Re: Extract a value from text

Hi,

 

You can use JMP's string operations for this. Read up on Contains(), Munger(), Substr(), Word(), Words(), Right(), Left(), etc. Here I've used munger and contains to isolate the number. The num() function changes the string found, "550" into the number 550.

 

Cheers,

Brady

 

Names Default To Here( 1 );

txt =
"\[PP, PPr (don’t forget to measure standard wafer SMM PPr WAL S0782-3, "Redarect PPr new" recipe (On WE9LDIP ONLY)) and UVX all (redirect), and run on click vale for mismatch info, Final PP
std Pli = 550 average value1 = … (Run/Std = >5.00) 100 / 120 = 0.8333
DOD tap and bottom on monitor only.]\";

beg = Contains( txt, "std Pli = " ) + 10;
end = Contains( txt, " ", beg );
val = Num( Munger( txt, beg, end - beg ) );
jthi
Super User


Re: Extract a value from text

Many ways to do this in JMP. Here is one:

Names Default To Here(1);

str = "\[PP, PPr (don’t forget to measure standard wafer SMM PPr WAL S0782-3, "Redarect PPr new" recipe (On WE9LDIP ONLY)) and UVX all (redirect), and run on click vale for mismatch info, Final PP
std Pli = 550 average value1 = … (Run/Std = >5.00) 100 / 120 = 0.8333
DOD tap and bottom on monitor only]\";
searchString = "std Pli = ";

//substr
firstSplit = Substr(str, Contains(str, searchString) + Length(searchString));
substr_result = Substr(firstSplit, 1, Contains(firstSplit, " ") - 1);
Show(substr_result);

 

Also if know how use regex you could use that:

regex_result = Regex(str, "(std Pli = )(\d+)", "\2");
Show(regex_result);

 

 

 

-Jarmo
swiergi11
Level III


Re: Extract a value from text

thanks a lot, all suggestions works well.

Recommended Articles