提取特定的刺你好,
我想從行中提取 bin 值並存儲在列表中。
例如-
BIN = "B" 8 "Bad Bump" -> 我想從字符串中提取字母“B”並存儲在列表中
BIN = "P" 6153 "PCM" -> 我想從字符串中提取字母“P”並存儲在列表中,同樣適用於包含 bin 的所有行
這是我到目前為止所嘗試的。 它只提取第 13 行
Names Default To Here( 1 );
Clear Globals();
Clear Log();
dt = current data table();
asa = dt << Get Rows Where (Contains(as column(3), "BIN") & Contains(as column(3), "NULL") == 0);
binlist = {};
startrownumber= asa[1];
for(k =1, k<= Nitems(asa), k++,
Insertinto(binlist, db_test:Bins[asa])
);
binvaluelist= {};
for (i = startrownumber, i <= nitems(asa), i++,
newlist = dt:Bins[i];
word_list = words(newlist, "\!"\!"");
insertinto(binvaluelist, word_list);
);
腳本回复:提取特定的刺如果這與從將文本文件中的 x 和 y 值導入 jmp 表並創建晶圓圖我會使用不同的方法。 但是讓我們假設我們從現有的數據表開始。
如果模式始終保持不變,我很可能會使用 Regex:
Names Default To Here(1);
dt = Open("$DOWNLOADS/Bin table.jmp");
bins = {};
bin_rgx = "\[(?:BIN = \")(.*)(?:\" \d*)]\";
For Each Row(dt,
If(Starts With(:Bins, "BIN = "),
bin_str = Regex(:Bins, bin_rgx, "\1");
Insert Into(bins, bin_str);
);
);
show(bins); // bins = {".", "1", "2", "B", "P", "N", "A", "3", "F"};回复:提取特定的刺謝謝亞莫。 有用
回复:提取特定的刺@jthi
我嘗試了不同的晶圓,但它不適用於某些垃圾箱
垃圾箱 = 4
BIN = "A" 2 "Alignment_Die"
BIN = "C" 28615 "D1QM1804101"
BIN = "D" 23501 "D1QM1804102"
BIN = "F" 0 "失敗" ""
BIN = "N" 0 "未測試"
BIN = "P" 2806 "PCM 模具" ""
垃圾箱 = {“A”、“C”、“D”、“F\!” 0 \!"失敗"、"N"、"P\!" 2806 \!"PCM 死"};
dt = current data table();
bins = {};
bin_rgx = "\[(?:BIN = \")(.*)(?:\" \d*)]\";
For Each Row(dt,
If(Starts With(:Bins, "BIN = "),
bin_str = Regex(:Bins, bin_rgx, "\1");
Insert Into(bins, bin_str);
);
);
show(bins); // bins = {"A", "C", "D", "F\!" 0 \!"Fail", "N", "P\!" 2806 \!"PCM die"};
回复:提取特定的刺我建議在 JMP 或https://regex101.com/r/DPngn1/1 . 選擇一個失敗的字符串,然後對其進行測試,看看它是如何失敗的以及失敗的原因。 在這種情況下,我的正則表達式模式確實需要稍微修改,因為它有時匹配太多。