Subscribe Bookmark RSS Feed

How drop scripts and notes when concatenating data tables?

terapin

Community Trekker

Joined:

Jun 23, 2011

Is there a method for dropping any notes or scripts contained in a data table when concatenating it with another? I routinely concatenate multiple files together and I don't need to see the notes or scripts from them in the master file to which they are concatenated. I've looked in the JMP manual but haven't found anything about this.  Thanks.

1 ACCEPTED SOLUTION

Accepted Solutions
ian_jmp

Staff

Joined:

Jun 23, 2011

Solution

Using a JSL script you can use something like:

// dt1 (dt2) is a table reference to the master table (table with new data)

// Make the results table, dt3, using 'Concatenate'

dt3 = dt2 << Concatenate(dt2);

// Get a list of all the table variables in dt3

v = dt3 << GetTablevariableNames;

// Get a list of all the table scripts in dt3

s = dt3 << GetTableScriptNames;

// Delete the variables in dt3

For (i=1, i<=NItems(v), i++,

  dt3 << DeleteTableVariable(v[i]);

);

// Delete the scripts in dt3

For (i=1, i<=NItems(s), i++,

  dt3 << DeleteTableProperty(s[i]);

);

Note that this deletes all variables and properties from the final table, but you could modify the logic to get the behaviour you require.

3 REPLIES
ian_jmp

Staff

Joined:

Jun 23, 2011

Solution

Using a JSL script you can use something like:

// dt1 (dt2) is a table reference to the master table (table with new data)

// Make the results table, dt3, using 'Concatenate'

dt3 = dt2 << Concatenate(dt2);

// Get a list of all the table variables in dt3

v = dt3 << GetTablevariableNames;

// Get a list of all the table scripts in dt3

s = dt3 << GetTableScriptNames;

// Delete the variables in dt3

For (i=1, i<=NItems(v), i++,

  dt3 << DeleteTableVariable(v[i]);

);

// Delete the scripts in dt3

For (i=1, i<=NItems(s), i++,

  dt3 << DeleteTableProperty(s[i]);

);

Note that this deletes all variables and properties from the final table, but you could modify the logic to get the behaviour you require.

terapin

Community Trekker

Joined:

Jun 23, 2011

Brilliant,

Thanks Ian for letting me know about these JSL commands.  I looked for something like them but clearly didn't use the correct syntax in my search of the JSL Scripting Index.

rc_hertzy

Community Trekker

Joined:

Jun 23, 2011

Almost correct:  the Concatenate statement should be

dt3 = dt2 << Concatenate(dt1);