みなさん、こんにちは。データファイルの6列ごとに結合して、新しい列にする必要があります。 コードを簡単にするためだけに、すべての結合列を新しいデータファイルに格納できるかどうかを確認しました。 添付のサンプルデータとお探しの出力画像をご覧ください。
また、リストからすべての「n」要素/および最初の「n」要素を抽出するにはどうすればよいですか?
助けてください。
ありがとう。
こんにちはハリ
別館としての私の解決策。 (サンプルデータに基づく)
良い一日を過ごしてください。
入力JMPテーブルが与えられると、以下のスクリプトはJPGファイルが示すように新しい列を生成します。JSLは、入力データが文字列または数値列の場合に機能します。

names default to here(1);
dt=current data table();
// Get all columns in data table
allCols = dt << get column names(character,string);
// Setup the names of the new columns to be created
varNames = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
// Loop across the columns 6 at a time creating the new column
For(i=1,i<=nitems(allCols),i=i+6,
dtName = substr(varNames,(i+5)/6,1);
// Create the JSL command to generate the formula
theExpr = "new column(dtName, character,
formula(
theList = {};
insert into(theList,char(:\!"" || allCols[i] || "\!"n));
insert into(theList,char(:\!"" || allCols[i+1] || "\!"n));
insert into(theList,char(:\!"" || allCols[i+2] || "\!"n));
insert into(theList,char(:\!"" || allCols[i+3] || "\!"n));
insert into(theList,char(:\!"" || allCols[i+4] || "\!"n));
insert into(theList,char(:\!"" || allCols[i+5] || "\!"n));
Concat Items(theList,\!"-\!");
)
)";
// Run the created JSL
eval(parse(theExpr));
// Turn column values into static values
column(dt,dtName)<<DELETE formula=""></DELETE>
ネルソンに感謝します、それはうまくいきました。
再度、感謝します。