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.
  • Graph Builder Toolbar streamlines interactive graphing. Creates shortcuts on Report and GraphBuilder Helpers toolbars. Download and install the extension.
  • JMP will suspend normal business operations for our Rest and Recharge Day on Friday, October 2, 2026.
    Regular business hours will resume on Monday, October 5, 2026.

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