使用列屬性更改列名稱的腳本您好,我正在嘗試編寫腳本,將我的列名稱替換為名為“Description”的特定列屬性。 如何提取描述下存儲的內容並將其用作新的列名稱?

我嘗試運行自己的腳本,但並沒有真正成功
dt = Current Data Table();
For( i = i, i <= N Cols( dt ), i++,
newname = (Column( dt, i ) << Get Column Properties("Description"));
Column( dt, i ) << Set Name(newname);
);
感謝您的幫助!
回复:使用列屬性更改列名稱的腳本吉姆,劇本現在可以運行了!只需將“獲取屬性”調整為“獲取屬性”即可。非常感謝 :)
回复:使用列屬性更改列名稱的腳本如果刪除所有數據行,您應該能夠上傳數據表。您需要完成的操作不需要任何數據行。
即使不使用調試器,您也可以單步執行代碼行。只要放一個
扔();
在您的代碼中,在出現問題的地方停止執行。您可以逐條突出顯示語句並運行每一行。通過將鼠標懸停在感興趣的變量上,您可以看到它們具有什麼值。
回复:使用列屬性更改列名稱的腳本吉姆,我認為我無法上傳,因為它是包含 17 萬行信息的專有公司數據。
您對我應該在數據表中檢查哪些內容有什麼建議嗎?
回复:使用列屬性更改列名稱的腳本你能上傳你的數據表嗎,我會進一步研究這個問題回复:使用列屬性更改列名稱的腳本謝謝吉姆! 不幸的是,即使按照您建議的調整,它仍然無法正常工作。 我不確定這是否是我的文件。 我嘗試使用“調試腳本”選項,但它崩潰了。 我在 JMP 14.1 和 15.0 上都進行了嘗試,但都無法執行調試腳本。
回复:使用列屬性更改列名稱的腳本偉大的嘗試......關閉但只有一些,主要是語法問題。您需要開始在腳本索引中查找您嘗試使用的函數的示例。
// Isolate the code to only impacting this script
// and not all scripts
Names Default To Here( 1 );
dt = Current Data Table();
// i=1 rather than i=i
For( i = 1, i <= N Cols( dt ), i++,
// Get Properties rather than Get Column Properties
newname = Column( dt, i ) << Get Properties( "Description" );
// If there isn't a Description Column Property you do not
// want to change the column name
If( Is String( newname ),
Column( dt, i ) << Set Name( newname )
);
);
回复:使用列屬性更改列名稱的腳本@ShahirahLoqman ,
請參閱下面的腳本。語法是獲取屬性(“名稱”)
Names Default to Here(1);
dt = New Table( "TestIt",
Add Rows( 5 ),
New Column( "A",
Numeric,
"Continuous",
Format( "Best", 12 ),
Set Property( "Description", "A description" ),
Set Values( [1, 2, 3, 4, 5] )
),
New Column( "B",
Numeric,
"Continuous",
Format( "Best", 12 ),
Set Property( "Description", "Heck if I know" ),
Set Values( [275, 300, 295, 280, 385] )
)
);
For(i=1, i<=ncol(dt), i++,
_xx = column(dt,i) << get property("Description");
show(_xx);
if( IsString(_xx), column(dt,i) << set name(_xx) );
);