H come posso dividere l'intera tabella per, in una colonna?
Come mostrato nella figura sotto, vorrei dividere l'intera bibbia per, nella colonna!
Quindi ho scritto lo script, ma non ho funzionato il codice concatenato.
Inoltre, se il, è così tanti, questo script è così inefficiente.
Come posso modificare il codice in modo più efficiente? (usando il per o while?)

dt = current data table();
newdt = dt << Subset( Output Table Name( "Graph table" ), All Columns( 1 ), All Rows( 1 ) ) ;
newdt << Select Where( Contains ( :As is Config , ",")) ;
newdt2 = newdt << Subset( Output Table Name( "Subset1" ), All Columns( 1 ), Selected Rows( 1 ) ) ;
newdt << new column("new As is Config", Formula(Left( :As is Config, Contains( :As is Config, "," ) - 1 )));
column(newdt, "new As is Config" ) << Eval Formula;
column(newdt, "new As is Config") << Delete Column Property( "Formula" );
column(newdt, "As is Config" ) << Formula(:new As is Config);
column(newdt, "As is Config" ) << Eval Formula;
column(newdt, "As is Config") << Delete Column Property( "Formula" );
newdt << Delete Columns( "new As is Config" );
newdt2 << new column("new As is Config", Formula(Substr(:As is Config, Contains( :As is Config, "," ) + 1, 100)));
column(newdt2, "new As is Config" ) << Eval Formula;
column(newdt2, "new As is Config") << Delete Column Property( "Formula" );
column(newdt2, "As is Config" ) << Formula(:new As is Config);
column(newdt2, "As is Config" ) << Eval Formula;
column(newdt2, "As is Config") << Delete Column Property( "Formula" );
newdt2 << Delete Columns( "new As is Config" );
newdt2 << Select Where( Contains ( :As is Config , ",")) ;
newdt3 = newdt2 << Subset( Output Table Name( "Subset2" ), All Columns( 1 ), Selected Rows( 1 ) ) ;
newdt2 << new column("new As is Config", Formula(Left( :As is Config, Contains( :As is Config, "," ) - 1 )));
column(newdt2, "new As is Config" ) << Eval Formula;
column(newdt2, "new As is Config") << Delete Column Property( "Formula" );
column(newdt2, "As is Config" ) << Formula(:new As is Config);
column(newdt2, "As is Config" ) << Eval Formula;
column(newdt2, "As is Config") << Delete Column Property( "Formula" );
newdt2 << Delete Columns( "new As is Config" );
newdt3 << new column("new As is Config", Formula(Substr(:As is Config, Contains( :As is Config, "," ) + 1, 100)));
column(newdt3, "new As is Config" ) << Eval Formula;
column(newdt3, "new As is Config") << Delete Column Property( "Formula" );
column(newdt3, "As is Config" ) << Formula(:new As is Config);
column(newdt3, "As is Config" ) << Eval Formula;
column(newdt3, "As is Config") << Delete Column Property( "Formula" );
newdt3 << Delete Columns( "new As is Config" );
newdt3 << Select Where( Contains ( :As is Config , ",")) ;
newdt4 = newdt3 << Subset( Output Table Name( "Subset3" ), All Columns( 1 ), Selected Rows( 1 ) ) ;
newdt3 << new column("new As is Config", Formula(Left( :As is Config, Contains( :As is Config, "," ) - 1 )));
column(newdt3, "new As is Config" ) << Eval Formula;
column(newdt3, "new As is Config") << Delete Column Property( "Formula" );
column(newdt3, "As is Config" ) << Formula(:new As is Config);
column(newdt3, "As is Config" ) << Eval Formula;
column(newdt3, "As is Config") << Delete Column Property( "Formula" );
newdt3 << Delete Columns( "new As is Config" );
both = newdt << concatenate( Graph table, Subset1, Subset2, "Append to first Table"); // this code is not working...Il mio primo commento, è di dare un'occhiata al
Testo in colonne ()
funzione, che ti permetterebbe di suddividere i valori C1, C2 ecc nelle loro colonne. Questo potrebbe darti un vantaggio mentre lavori attraverso il tuo codice.
Guarda anche la funzione Word () per aiutarti.
Infine, di seguito è riportata una modifica al codice di concatenazione che dovrebbe funzionare per te:
both = newdt << concatenate( Data Table("Graph table"),
Data Table("Subset1"),
Data Table("Subset2"),
Append to first Table(1));
Oh, grazie
Ho rifatto questo codice, ma non funziona TT
qual è il problema?? in questo script ...
Names Default To Here( 1 );
dt = Current Data Table();
newdt = dt << Subset( Output Table Name( "Graph table" ), All Columns( 1 ), All Rows( 1 ) );
//Graph table
newdt << Select columns( :As is Config );
N = newdt << Subset( Output Table Name( "N" ), Selected Columns( 1 ), All Rows( 1 ) );
nColNow = N Items( n << get column names );
n << text to columns( delimiter( "," ), columns( :As is Config ) );
colAdded = N Items( n << get column names ) - nColNow;
For( i = 1, i <= colAdded, i++,
newdt[i] << Select Where( Contains( :As is Config, "," ) );
newdt[i + 1] = newdt << Subset( Output Table Name( "Subset" ), All Columns( 1 ), Selected Rows( 1 ) );
newdt[i] << New Column( "new As is Config",
Formula( Left( :As is Config, Contains( :As is Config, "," ) - 1 ) )
);
Column( newdt[i], "new As is Config" ) << Eval Formula; //Formula 특성 계싼!!
Column( newdt[i], "new As is Config" ) << Delete Column Property( "Formula" ); //formula 특성 지우기
Column( newdt[i], "As is Config" ) << Formula( :new As is Config );
Column( newdt[i], "As is Config" ) << Eval Formula; //Formula 특성 계싼!!
Column( newdt[i], "As is Config" ) << Delete Column Property( "Formula" ); //formula 특성 지우기
newdt[i] << Delete Columns( "new As is Config" ); // new As is Config 삭제!!
newdt[i + 1] << New Column( "new As is Config",
Formula( Substr( :As is Config, Contains( :As is Config, "," ) + 1, 100 ) )
);
Column( newdt[i + 1], "new As is Config" ) << Eval Formula; //Formula 특성 계싼!!
Column( newdt[i + 1], "new As is Config" ) << Delete Column Property( "Formula" ); //formula 특성 지우기
Column( newdt[i + 1], "As is Config" ) << Formula( :new As is Config );
Column( newdt[i + 1], "As is Config" ) << Eval Formula; //Formula 특성 계싼!!
Column( newdt[i + 1], "As is Config" ) << Delete Column Property( "Formula" ); //formula 특성 지우기
newdt[i + 1] << Delete Columns( "new As is Config" ); // new As is Config 삭제!!
newdt[i + 1] << Select Where( Contains( :As is Config, "," ) );
newdt[i + 2] = newdt[i + 1] << Subset(
Output Table Name( "Subset" ),
All Columns( 1 ),
Selected Rows( 1 )
);
);