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
UserID16644
Level V

Remove character strings

I have this column SAMPLE where I need only to retain the code inside the () but somehow, I cannot remove the Column% word and the parenthesis. I tried using Word(2,:SAMPLE) but it only returned an error. 

 

How to remove the word Column % and the parenthesis from the string?

UserID16644_0-1685600613666.png

 

1 ACCEPTED SOLUTION

Accepted Solutions
jthi
Super User

Re: Remove character strings

Using Word seems to work fine for me

Names Default To Here(1);

dt = New Table("Untitled 18",
	Add Rows(1),
	Compress File When Saved(1),
	New Column("S", Character, "Nominal", Set Values({"COLUMN %(AC353)"}))
);

dt << New Column("", Character, Nominal, Formula(
	Word(2, :S)
));

Could you provide the datatable instead of an image? Also changing the separator to () instead of " " (default) might work

	Word(2, :S, "()")
-Jarmo

View solution in original post

3 REPLIES 3
jthi
Super User

Re: Remove character strings

Using Word seems to work fine for me

Names Default To Here(1);

dt = New Table("Untitled 18",
	Add Rows(1),
	Compress File When Saved(1),
	New Column("S", Character, "Nominal", Set Values({"COLUMN %(AC353)"}))
);

dt << New Column("", Character, Nominal, Formula(
	Word(2, :S)
));

Could you provide the datatable instead of an image? Also changing the separator to () instead of " " (default) might work

	Word(2, :S, "()")
-Jarmo
UserID16644
Level V

Re: Remove character strings

Attached file is the sample data table. What I want is that only AC353, AEE67 and so on would be the only values of the column sample.

jthi
Super User

Re: Remove character strings

Formula I provided with "()" should work, just replace :S with correct column

jthi_0-1685602732155.png

 

-Jarmo

Recommended Articles