cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • Don’t miss your chance to experience Discovery Summit Europe at our best available rate! Early bird registration through 31 Oct.
  • Image to Table JMP extension imports single or batch images as data tables. Useful to extract curves from pictures or convert image data to curve data to use in analyses like Functional Data Explorer. Download and install the extension.

Discussions

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

Extract String which has positive and negative numbers

Hi,

I have a table1.jmp as atteched. How do I extract the X and Y as circled in the red box? The X and Y values can sometimes be negative. For example, the XY values from the 1st row is -280,-396. The XY values from the 2nd row is 284,-228.

cchueng_0-1744749768432.png

 

3 REPLIES 3
cchueng
Level IV

Re: Extract String which has positive and negtive numbers

This is a tough one. Any wise advice?

txnelson
Super User

Re: Extract String which has positive and negtive numbers

Here are the formulas that will do what you want

// For the X value
Num( Substitute( Word( 5, Substitute( :Fname, "--", "-&" ), "-" ), "&", "-" ) )

// For the Y value
Num( Substitute( Word( 6, Substitute( :Fname, "--", "-&" ), "-" ), "&", "-" ) )

txnelson_0-1768422481962.png

 

Jim
jthi
Super User

Re: Extract String which has positive and negtive numbers

Regex can also be an option (https://regex101.com/r/5fgzrx/1 for partial explanation on how this works)

Num(Regex(:Fname, "-(-?\d{3})-(-?\d{3})", "\1"))

change "\1" to "\2" for Y

jthi_0-1768939456727.png

 

-Jarmo

Recommended Articles