How do I use the "text to column" method but without manually renaming all the splitted columns afterwards?
Hi,
There are a few ways to do this.
Scripting:
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])
);
Cut and paste:
Place the new column names in a single column of a table, select them all, and copy them with a CTRL-C (CMD-C on Mac).

Perform the Text To Columns operation, then select the new columns and press CTRL-V to paste the new names.


Using Recode Column Names
First, use Text To Columns to split the column of interest.
Next, Select Cols > Column Names > Recode Column Names... from the main menu.

Enter the new column names as desired, then click the Recode button to finish.

Table and script attached.
Cheers,
Brady
How would you want the new columns named?