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
weilyne
Level I

Split whole string into 2 new column

table<< New Column("d0", Character, Nominal, Formula(Word(Column(table, "Data"), "_", 1, 3)));
table<< New Column("d1", Character, Nominal, Formula(Word(Column(table, "Data"), "_", 4, 6)));

string= 1_1_1_1_1_1
wanted to split this string into 2 column with data 1_1_1 for d0 and 1_1_1 for d1. Somehow the script above not working

1 REPLY 1
Thierry_S
Super User

Re: Split whole string into 2 new column

Hi,

 

The Word function allows for ranges in the first term. Hence, you can extract the first set of 3 meaningful characters/digits and the last 3 with the formulas below.

Word( [1 3], :Data, "_" );

Word( [4 -1], :Data, "_" );

Note: The Last Word is represented by the "-1" position.

 

Let me know if it works for your needs.

Best,

TS

Thierry R. Sornasse

Recommended Articles