大家好,
我有一段 jsl 代碼,它獲取我的數據表並分割可變數量的列(下面附有代碼)。
//Variable Table splitting operation
dt_split = new << Split(
Split By( :SamplePos, :File ID ),
Split( Eval List( EmitCols ) ), //Here is the line where I choose a variable amount of columns within the data table to split
Group(:Cycles),
Output Table( "Split_Table" ),
Remaining Columns( keep all ),
Sort by Column Property
當 EmitCols 中指定的列大於 1 時,它返回一個數據表,其中新列用 EmitCols 中指定的每列的名稱進行註釋,但是,當 EmitCols 中只有 1 列時,它會省略用該名稱註釋新列。 split() 函數中是否有一個屬性,可以在僅按 1 列拆分時保留註釋? 如果沒有,有沒有辦法克服這種行為?
編輯:我嘗試搜索腳本索引,到目前為止我找不到任何允許我執行此操作的 split 屬性。
好的,所以我可以看到發生了什麼,我可以明白為什麼它是這樣開發的,而且,我看不到解決它的簡單方法。 所以這裡有一個蠻力方法,以最不優雅的方式。
dt<<NEW column="">1,insert into(del, clist[i]));
);
dt << Select Columns( del );
dt << Delete Columns();</NEW>