cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Try the Materials Informatics Toolkit, which is designed to easily handle SMILES data. This and other helpful add-ins are available in the JMP® Marketplace
Choose Language Hide Translation Bar
baba
Level I

JMP Scripting

Hello I am new to JMP Scripting and wandering if there is way to use regular expressions ?

I have huge tables and trying to stack them with JMP.

So any help on how would i ...

Data Table( "temp" ) << Stack(

columns(

  :Name( "ABC0(1)" ),

  :Name( "ABC0(2)" ),

  :Name( "ABC0(128)" )

),

Source Label Column( "Label" ),

Stacked Data Column( "Data" ),

output table("npt")

);

I have DATA = ABC0 to 127 and (1 to 128)... writing :Name takes too many lines...

Thanks,

Nevil

1 REPLY 1
pmroz
Super User

Re: JMP Scripting

Here's one way to do it.  Basically you build a string and then execute it.

stack_expr = "\[Data Table( "temp" ) << Stack( columns(]\";

nc = 128;    // Set for your table

for (i = 1, i <= nc, i++,

    k = char(i);

    stack_expr = stack_expr || evalinsert("\[ :Name( "ABC0(^k^)" ) ]\");

// Add the comma between columns, except for the last one

    if (i < nc,

        stack_expr = stack_expr || ", ";

    );

);

stack_expr = stack_expr ||

"\[Source Label Column( "Label" ),

   Stacked Data Column( "Data" ),

   output table("npt"))]\";

eval(parse(stack_expr));