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!
  • Use World Cup data to build models, explore spatial relationships, and create informative visualizations in JMP. Register. July 17, 2 pm US Eastern Time.
  • Your voice matters! Tell us how you prefer to receive JMP updates, so we can tailor our communication to your needs. Take short survey.

Discussions

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

Find words within a column and relace it with with blank

Hello JMP community,

 

I want to remove ppm. from column 9 and store only numbers in column 10.

Can you please suggest any way to perform this task?

 

chandankishor66_0-1668438647593.png

 

Many thanks,

 

 

1 ACCEPTED SOLUTION

Accepted Solutions

Re: Find words within a column and relace it with with blank

Hi Chandan,

Assuming "ppm" is always the thing you want to remove, creating a new formula column to keep only the first word, while using "ppm" as a delimiter should work. Formula for this below:

Num(Word(1, :Column 9, "ppm"))

View solution in original post

4 REPLIES 4
jthi
Super User

Re: Find words within a column and relace it with with blank

Using formula with Substitute() is one option (replace "851 ppm." with :Column 9)

Substitute("851 ppm.", "ppm.", "");

 Edit:

Might have to add Trim Whitespace()/Num() around substitute

-Jarmo

Re: Find words within a column and relace it with with blank

Hi Chandan,

Assuming "ppm" is always the thing you want to remove, creating a new formula column to keep only the first word, while using "ppm" as a delimiter should work. Formula for this below:

Num(Word(1, :Column 9, "ppm"))
pauldeen
Level VI

Re: Find words within a column and relace it with with blank

Create a new column with the formula:

Num( Regex( :Column 9, "\d+" ) )

\d means find valid digits. + means as many as possible. The whole result is type cast back into a number by the num() around it.

hogi
Level XIII

Re: Find words within a column and relace it with with blank

The regex version is nice.

If you don't want the rounded number:

Regex( :Column 9, "\d+,\d+" );

edited: as I just noticed that the numbers have comma as decimal separator
I think it's a good idea to have ponit as the standard in jmp and convert commas to points as soon as the file is loaded.

Recommended Articles