無法刪除資料表中的列早安,
我目前正在編寫一個腳本,以便從 Excel 文件中提取資料並格式化資料表。
這篇文章附有一個典型的例子。
我擔心的是我無法刪除最後一列(第六列到最後)。 您知道問題出在哪裡嗎?
在此先感謝您的幫忙!
回覆:無法刪除資料表中的列問題已解決,謝謝!回覆:無法刪除資料表中的列刪除列會變更表的維度,這可能會導致前向循環失敗。嘗試從末尾刪除。
dt = Current Data Table();
n = N Col(dt);
// Delete last six columns columns, starting from the end
For(i = n, i > n - 6, i--,
dt << delete columns(Column(i))
);
// This should also work: delete very last column six times
For(i = 1, i <= 6, i++,
dt << delete columns(Column(N Col(dt)))
);