你好 - 我有 5 组,每组 57 列 (5 x 57),我需要重新排列它们,以便点赞。我已从 JMP 表中剪切并粘贴了列的示例。列名称有五组前缀(同样,每组都有 57 个与化合物对应的列名称):
1 - RES_VALUES_
2 - RES_TEXT_
3 - 检测标志_
4 - RL_
5 - 稀释因子_
每个后跟一个与化合物名称相对应的后缀(共有 57 个)。
我想将每个化合物名称组合在一起。因此,例如,一种化合物,例如“4:2 FTS”,将按如下列顺序列出:RES_VALUE_4:2 FTS、RES_TEXT_4:2 FTS、DETECT_FLAG_4:2 FTS、RL_4:2 FTS、DILUTION_FACTOR_4:2 FTS。对于每种化合物都会重复该序列。我最终会得到一个可以轻松探索的表格,其中每个化合物的相关信息都在一起。前 5 列将为 4:2 FTS。第二个 5 将是下一个化合物,6:2 FTS。等等。
有没有一种有效的方法来做到这一点而不是拖放?提前致谢!





这是一个小脚本,我认为它可以满足您的需求。它按照您的建议对列进行排序,并将每个化合物分组到单独的列组中。
Names default to here(1);
groupList = {"RES_VALUE","RES_TEXT", "DETECT_FLAG", "RL", "DILUTION_FACTOR" };
// The comment lines below, when uncommented will create a small example data table
// that was used to test the code
/*compList = {"4:2 FTS", "6:2 FTS", "ADONA" };
New Table("Example");
for each({group}, groupList,
for each({comp},compList,
New Column(group || " " || comp)
)
);*/
dt = current data table();
// Find all of the different compounds. This is done by using the "RES_VALUE" columns
// and stripping off the compound names from each of them
compList = {};
For( i=1,i<=N Cols(dt), i++,
colName = column(dt,i)<<GET name=""></GET>