分割されたすべての列の名前を後で手動で変更せずに、「テキストから列へ」の方法を使用するにはどうすればよいですか?
こんにちは、
これを行うにはいくつかの方法があります。
スクリプティング:
Names Default To Here(1);
dt = open("ExTable.jmp");
//find column position of column to be split
columnPosition = contains(dt << get column names(string), "CombinedFields");
//determine original number of columns
originalNumCols = ncol(dt);
//new names here...
newColNames = {"Model", "Country", "Type"};
//split the column
dt << Text to Columns( columns( :CombinedFields ), Delimiters( "," ) );
//how many new columns are there?
numColsCreated = ncol(dt) - originalNumCols;
//loop through the new columns, using original column's position as an offset, and change names
for(i = 1, i<=numColsCreated, i++,
column(dt, columnPosition + i) << set name(newColNames[i])
);
カット&ペースト:
新しい列名をテーブルの1つの列に配置し、それらをすべて選択して、CTRL-C(Macの場合はCMD-C)でコピーします。

Text To Columns操作を実行してから、新しい列を選択し、CTRL-Vを押して新しい名前を貼り付けます。


使用する列名を再コーディングする
まず、Text To Columnsを使用して、対象の列を分割します。
次、 [列]> [列名]> [列名の再コード化...]を選択します。メインメニューから。

必要に応じて新しい列名を入力し、[再コーディング終了するボタン。

表とスクリプトを添付。
乾杯、
ブレイディ