cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • Learn how to build custom Python data connectors and further customize JMP’s Data Connector Framework with the Python Data Connector Demo, available now in the JMP Marketplace!
  • See how to create experiments to support product design and ID useful product features. Register for June 12 webinar, 2pm US Eastern Time.

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