hey folks,
I am using a previous example from the forum.
My code works for the first part I am doing.
When I add the value into the new row I want to increment machine by 1.
So below would like ABC_RC1,RC2,RC3... not sure how to do this part.
machine | operation | recipename | Data_Column |
ABC_RC | 123456 | TEST | [0.941279597;0.941279597;0.947636808] |
Names Default To Here( 1 );
dt = Data Table( "Untitled 166");
dtOut = New Table( "Final Output1",
New Column( "machine", character ),
New Column( "operation", numeric ),
New Column( "recipename", character ),
New Column( "Data_Column", character ),
New Column( "Data_1", numeric ),
);
For( i = 1, i <= N Rows( dt ), i++,
If( i == 1,
theRow = 0;
theRow = N Rows( dtOut );
);
If( dt:Data_Column[i] != "X",
dtOut << Add Rows( 3 );
For( k = 1, k <= 3, k++,
theRow++;
dtOut:machine[theRow] = dt:machine[i];
dtOut:operation[theRow] = dt:operation[i];
dtOut:recipename[theRow] = dt:recipename[i];
dtOut:Data_Column[theRow] = dt:Data_Column[i];
dtOut:Data_1[theRow] = Substr( Word( k, dt:Data_Column[i], ";" ), 2, 7 );
);
);
);