cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Submit your abstract to the call for content for Discovery Summit Americas by April 23. Selected abstracts will be presented at Discovery Summit, Oct. 21- 24.
Discovery is online this week, April 16 and 18. Join us for these exciting interactive sessions.
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));