刪除不同表中的列<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中的保留函數。
邁克爾