Text to Cols JMP Add-In
Written by Jeff Perkinson
Version 3 now adds a callable JSL function. See Version notes below for details.
Text to Cols creates new columns from a column of delimited text. As shown above, the column “Data” has a comma-delimited string. Text to Cols creates the six new columns to the right.
After installing the Text to Cols add-in, you’ll find a new menu at the bottom of the Cols menu.
When you select this menu item, you’ll be prompted to choose a column of text and specify the delimiter.
Select your column and click OK.
New columns are added to the data table to contain the values from your column. Each new column has a formula using the Word() function to derive its value.
Version 2 updates
This version is built with the Application Builder. It uses a faster algorithm making it more efficient when dealing with lots of rows. It will also work on multiple columns at once.
Version 3 updates
Support for calling Text To Cols from JSL by adding a com.jmp.jperk namespace with a function.
com.jmp.jperk:texttocolumns( column, delimiters, <data table=current data table()>)
Description
Creates new columns in data table from a column of text using delimiters to define each column
Returns
An associative array
{{”columns”, list of columns created}, {”name”, text string with name of column group containing columns}}
Arguments
column a JSL column reference of a text column to be split into multiple columns
delimiters a string of characters to be used as delimiters
data table optional reference to a data data table that column is in and to which should the new columns will be added. Current Data Table() will be used if no data table is specified.
Example:
bc_party = Open( "$SAMPLE_DATA\Consumer Preferences.jmp" );
com.jmp.jperk:texttocolumns( Column( bc_party , "floss delimited"), ",", bc_party );
Support
For help, comments, suggestions, questions, complaints or compliments, please email Jeff.Perkinson@jmp.com.