cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Try the Materials Informatics Toolkit, which is designed to easily handle SMILES data. This and other helpful add-ins are available in the JMP® Marketplace
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