如何使用 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("|"));