How can I parse a string in 1 column use jsl?I want to use jsl to split data in column "result" with delimiter "|" to new column "PIN" and "value". Kindly help, thank you in advance
Please refer my attachment

new table

Automation and ScriptingRe: How can I parse a string in 1 column use jsl?Split a Data Table Column into Multiple Columns (jmp.com)
Select your column

go to columns menu

set your delimilter

press OK and you have your result

copy script from enhanced log / workflow and modify it as needed
// Text to columns
Data Table("Sheet1") << Text to Columns(columns(:Result), Delimiters("|"));Re: How can I parse a string in 1 column use jsl?Given the data table

This JSL will produce the required new table
names default to here(1);
// Create a handle to point to the data table in question
dt = current data table();
// Convert the Result column into several columns
// Text to columns
dt << Text to Columns(
columns( :Result ),
Delimiters( "|" )
);
// Use a multiple series stack to stack the data
dtStack = dt << Stack(
columns( :Result 2, :Result 3, :Result 4, :Result 5, :Result 6, :Result 7 ),
Source Label Column( "Label" ),
Stacked Data Column( "Data" ),
"Non-stacked columns"n( Keep( :Unit#, :Result 1 ) ),
Number of Series( 2 ),
Output Table( "Untitled 20.jmp" )
);
// Delete unneeded columns
dtStack << delete columns(:Label,:Label2);
// Rename the stacked columns
dtStack:Result 1 << set name ("Number Of Tests");
dtStack:Data << set name("PIN");
dtStack:Data2 << set name("Value");

All of the above JSL was created by running the Text to Columns, Stack and Column name changes etc. interactively, and then going to the JMP log and cutting and pasting the JSL that JMP produced into a script window. I will confess to some cleaning up of cut and pasted JSL to make it look better.
Re: How can I parse a string in 1 column use jsl?- Replace the Stack code with this
// Get all of the column names
resultList = dt << get column names();
// Only the columns Result 2 thru Result N are to be
// stacked, so remove the first 3 columns from the list
remove from(resultList,1,3);
// Use a multiple series stack to stack the data
dtStack = dt << Stack(
columns( resultList ),
Source Label Column( "Label" ),
Stacked Data Column( "Data" ),
"Non-stacked columns"n( Keep( :Unit#, :Result 1 ) ),
Number of Series( 2 ),
Output Table( "Untitled 20.jmp" )
);
- Take the time to read the Scripting Guide available in the JMP Documentation Library available under the Help pull down menu.
Re: How can I parse a string in 1 column use jsl?thank you a lot
Re: How can I parse a string in 1 column use jsl?thanks Jim so much, it is very good solution
Re: How can I parse a string in 1 column use jsl?// Use a multiple series stack to stack the data
dtStack = dt << Stack(
columns( :Result 2, :Result 3, :Result 4, :Result 5, :Result 6, :Result 7 ),
in the step above, If my dataset return so many result up to result 120, and it variance may be more than 120 result, do we have any way to code jsl script to stack data Jim?
Re: How can I parse a string in 1 column use jsl?it so great, I have just went to JMP Documentation Library, I can find the guide. thank you a lot.