删除不同表中的列<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />嗨,
我尝试删除多个表上的列。
在第二个For循环中,我有一个无效的参数。 但只在第一张桌子上工作......
谢谢
杰夫
打开( “d:\ A.csv”);
打开( “d:\ B.csv”);
打开( “d:\ C.csv”);
t_count = N Table();
对于(i = 1,i <= t_count,i ++,
dt =数据表(i);
N = N Col(dt);
ColumnstoKeep = { “AA”,“BB”};
ColumnstoTrash = {};
对于(j = 1,j <= N,j ++,
colname = Column(j)<< getname(); / Debugger说invali参数!?/
如果(包含(ColumnstoKeep,colname)<1,
插入(ColumnstoTrash,colname)
);
);
dt <<删除列(ColumnstoTrash);
);
Re:删除不同表中的列非常感谢 :-)
Re:删除不同表中的列geof2,
您对column()函数的使用缺少对所需特定数据表的引用,因此您仅在当前表上操作。 这是C.csv表,它是你打开的最后一个。 使用列(dt,j)。 所以,对于你的第二个循环,使用:
对于(j = 1,j <= N,j ++,
colname = Column(dt,j)<< getname();
如果(包含(ColumnstoKeep,colname)<1,
插入(ColumnstoTrash,colname)
);
);
我还建议您使用除j之外的其他内容作为索引。 j是JMP中的保留函数。
迈克尔