Hello,
I'm an inexperienced JMP scriptor and I'm trying to write my first larg(er) script. I'm having trouble with one part. Here's what I'm trying to do: I have various data tables that I will use this script on. I would like the script to look at all of the columns, excluding the first column (column and row numbers will vary for each data table) and create a new column for each column already present in the table. I would like the name of each of the new columns to be the same as each of the original columns but with a "_code" at the end, and preferably be positioned next to the original column in the table. Within each new column I would like the formula to be an if/then statement. If "Column A" has the text "<" in the cell, then 0, otherwise 1.
I hope my explanation makes sense. I've posted my script although it seems to break at line 8 and I'm not sure why.
Thank you for any help!
Lacey
Names Default To Here( 1 );
dt = Current Data Table();
col_list = dt << get column names( string );
For( i = 2, i <= nitems( col_list ), i++,
data_col = ":" || col_list[i];
code_col = col_list[i] || "_Code";
str = evalinsert (
"\[dt << New Colum ("^code_col^", Numeric, Continuous,
Format("Best",12),
Formula(If( Contains( "^code_col^", "<" ),
0,
1
)));
);]\");
eval(parse(str));
);