如何使用 jsl 解析 1 列中的字符串?我想使用 jsl 用分隔符“|”分割“结果”列中的数据到新列“PIN”和“值”。请帮忙,提前谢谢
请参考我的附件

新表

自动化和脚本回复:如何使用 jsl 解析 1 列中的字符串?- 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" )
);
- 请花时间阅读“帮助”下拉菜单下 JMP 文档库中提供的脚本指南。
回复:如何使用 jsl 解析 1 列中的字符串?// 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 ),
在上面的步骤中,如果我的数据集返回这么多结果,直到结果120,并且方差可能超过120结果,我们是否有任何方法编写jsl脚本来堆叠数据Jim?
回复:如何使用 jsl 解析 1 列中的字符串?非常感谢吉姆,这是非常好的解决方案
回复:如何使用 jsl 解析 1 列中的字符串?万分感谢
回复:如何使用 jsl 解析 1 列中的字符串?给定数据表

该 JSL 将生成所需的新表
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");

上述所有 JSL 都是通过交互运行文本到列、堆栈和列名称更改等创建的,然后转到 JMP 日志并将 JMP 生成的 JSL 剪切并粘贴到脚本窗口中。我承认对剪切和粘贴的 JSL 进行了一些清理,以使其看起来更好。
回复:如何使用 jsl 解析 1 列中的字符串?将数据表列拆分为多个列 (jmp.com)
选择您的专栏

转到列菜单

设置你的分隔符

按“确定”,你就得到了结果

从增强日志/工作流程中复制脚本并根据需要进行修改
// Text to columns
Data Table("Sheet1") << Text to Columns(columns(:Result), Delimiters("|"));