簡單問題:如何找出列號你好社區,
我只想學習如何在 JMP 中找出列號。
我嘗試使用 Column Info,但此信息不存在。 我可以在 Cols > Column Selection > Go to.. 中輸入列號 ,但我不想嘗試猜測。
因為我想在我的腳本中使用列號來循環它(例如從 120 列到 130 列)。 但是為此我需要找出我的起始列(在我的例子中是“I_nA_3_m30_NS”)位於第 120 列..
謝謝你的幫助。
數據表回复:簡單問題:如何找出列號如果你想允許跨多個列的部分匹配,你可以讓'FilterColSelector()'做一些工作:
Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/big class.jmp" );
allCols = dt << getColumnNames("String");
fcs = Filter Col Selector( << nameContains("eight"));
matchingCols = fcs << getItems;
fcs << delete;
matchingColNumbers = [];
for(c=1, c<=NItems(matchingCols), c++, matchingColNumbers = matchingColNumbers||Loc(allCols, matchingCols[c]));
Print(matchingColNumbers);回复:簡單問題:如何找出列號你好,
好消息:我建議的方法假定您查找目標列的完整名稱,這在您查找子字符串的情況下無效。
讓我想想。
最好的,
TS
回复:簡單問題:如何找出列號Contains() 函數在用於比較 JMP 列表時僅返回完全匹配。如果您需要在內部查找列表中的每個元素,則需要執行以下操作:
Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/big class.jmp" );
cols = dt << get column names( string );
text = "wei";
For( i = 1, i <= N Items( cols ), i++,
tcol = Contains( cols[i], text );
If( tcol > 0,
tcol = i;
Break();
);
);
Show( tcol );
回复:簡單問題:如何找出列號謝謝你的回复,是個好主意,但對我沒用,我的tcol是0。
這是 cols 變量(與原始問題不同的另一個表):
{"標籤", "FitA_ 1", "FitA_ 2", "FitA_ 3", "FitA_ 4", "FitA_ 5", "FitA_ 6", "FitA_ 7", "FitA_ 8", "FitA_ 9", “FitA_10”、“FitA_11”、“FitA_12”、“FitB_1”、“FitB_2”、“FitB_3”、“FitB_4”、“FitB_5”、“FitB_6”、“FitB_7”、“FitB_8” ", "FitB_9", "FitB_10", "FitB_11", "FitB_12", "F", "H_1", "H_2", "H_3", "H_4", "H_5", "H_ 6", "H_7", "H_8", "H_9", "H_10", "H_11", "H_12", "V2_1", "V2_2", "V2_3", "V2_4", “V2_5”、“V2_6”、“V2_7”、“V2_8”、“V2_9”、“V2_10”、“V2_11”、“V2_12”、“V3_1”、“V3_2”、“V3_3” ", "V3_ 4", "V3_ 5", "V3_ 6", "V3_ 7", "V3_ 8", "V3_ 9", "V3_10", "V3_11", "V3_12", "NAT"}
我嘗試使用 text = "FitB"
但是 tcol 是 0
回复:簡單問題:如何找出列號解決這個問題的一種方法是:
Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/big class.jmp" );
colNumber = Contains( dt << get column names( string ), "height" );
Show( colNumber );
回复:簡單問題:如何找出列號你好,
下面是一種返回與文本模式匹配的第一列的相對位置的方法(在我看來是“VISIT”):
Names default to here (1);
dt = current data table ();
cols = dt << get column names (string);
text = "VISIT";
tcol = contains (cols, text);
show (tcol);
讓我們知道這是否適合您。
最好的,
TS