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

String Operations after Reading from Excel

Hello, 

 

I am reading a cell from Excel which is read by JMP as - "['299','523']". I need the string to be manipulated to be {"299","523"}. I am not able to do this. 

 

Any help would be appreciated. There probably is an easy solution but I cannot figure it out. 

 

Thanks,

Neel

3 REPLIES 3
txnelson
Super User

Re: String Operations after Reading from Excel

Use the Substitute() function to ca hange characters
Jim

Re: String Operations after Reading from Excel

Hi Jim, 

 

I tried that already, but I cannot replace " (double quotes) in the string with an empty space. Any suggestions?

 

This: temp = Substitute(string,""\", " "); doesn't work and I get errors.

 

Thanks!

jthi
Super User

Re: String Operations after Reading from Excel

Substitute should work fine here

Names Default To Here(1);

str = "['299','523']";

str2 = Substitute(str, "'", "\!"", "[", "{", "]", "}");

Write(str2);

You can find escape sequences for quoted strings here Scripting Guide > JSL Building Blocks > JSL Syntax Rules 

-Jarmo