简单问题:如何找出列号你好社区,
我只想学习如何在 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