Potresti usare Or e più istruzioni contains, Substitute per sostituire quelle stringhe e controllare la lunghezza o usare Regex. Ecco alcuni esempi per substitute e regex (substitute è molto probabilmente più veloce)
Names Default To Here(1);
dt = Open("$DOWNLOADS/sample table.jmp");
dt << select where(Length(:Chart) > Length(Substitute(:Chart, {"Trace thickness", "Trace width", "Insulator thicknes"}, {"", "", ""})));
// dt << select where(!Is Missing(Regex(:Chart, "Trace thickness|Trace width|Insulator thicknes")));
dt_subset = dt << Subset(Selected Rows, Selected Columns Only(0), Output Table("Subset"));
</CODE></P>
<P> </P></LINGO-BODY><LINGO-SUB id="lingo-sub-780361" slang="en-US" mode="CREATE">Ri: come usare contains per la selezione di più caratteri e sottoinsiemi?</LINGO-SUB><LINGO-BODY id="lingo-body-780361" slang="en-US" mode="CREATE"><P>Funziona e con grande efficienza. Grazie mille!</P></LINGO-BODY><LINGO-SUB id="lingo-sub-780364" slang="en-US" mode="CREATE">Ri: come usare contains per la selezione di più caratteri e sottoinsiemi?</LINGO-SUB><LINGO-BODY id="lingo-body-780364" slang="en-US" mode="CREATE"><P>Ciao Jarmo,</P><P> </P><P>Ho un'altra domanda su Recode, voglio ricodificare in base al grafico, filtrare tutti i caratteri quando ci sono caratteri "Trace Thickness" nel nome, ho bisogno di ricodificarli nel nuovo nome "TT"</P><P>ho uno script ma stessa domanda, non è buono. Potresti anche aiutarmi a controllare se hai una soluzione migliore per questo? Grazie mille! KRs Sean</P><PRE><CODE class=" language-jsl">Names Default To Here(1);
dt = Open( "$DESKTOP/sample table.jmp" );
dt << select where(Length(:Chart) > Length(Substitute(:Chart, {"Trace thickness", "Trace width", "Insulator thicknes"}, {"", "", ""})));
dt_subset = dt << Subset(Selected Rows, Selected Columns Only(0), Output Table("Subset"));
// Recode column: Category
dt = Data Table( "Subset" );
dt << Begin Data Update;
col1 = dt << New Column( dt:Chart );
col1 << Set Name( "Category" );
dt << Move Selected Columns( {col1}, after( dt:Chart ) );
dt << Recode Column(
dt:Chart,
{Map Value(
_rcOrig,
{"B 1B 110um Trace thickness", "TT", "B 2B 18um Trace thickness", "TT",
"B 2F 15um Trace thickness", "TT", "B 2F 24um Trace thickness,DE D", "TT",
"B 2F 32um Trace thickness,SE6", "TT", "B 3B 90um Trace thickness", "TT",
"B 3F 90um Trace thickness", "TT", "B 4B 18um Trace thickness", "TT",
"B 4F 13um Trace thickness,DE B", "TT", "B 4F 15um Trace thickness", "TT",
"B 4F 18um Trace thickness,DE B", "TT", "B 4F 24um Trace thickness,DE C",
"TT", "B 4F 30um Trace thickness,DE C", "TT",
"B 4F 32um Trace thickness,SE6", "TT", "B 4F 35.5um Trace thickness,SE6",
"TT", "B 4F 41um Trace thickness,SE2", "TT",
"B 4F 44.5um Trace thickness,SE2", "TT", "B 5B 90um Trace thickness", "TT",
"B 5F 90um Trace thickness", "TT", "B 6B 18um Trace thickness", "TT",
"B 6F 13.5um Trace thickness,SE5", "TT", "B 6F 14um Trace thickness", "TT",
"B 6F 15um Trace thickness,SE2 L2", "TT", "B 6F 15um Trace thickness,SE5",
"TT", "B 6F 17um Trace thickness,SE4", "TT", "B 6F 18.5um Trace thickness",
"TT", "B 6F 20um Trace thickness,SE3", "TT", "B 6F 20um Trace thickness,SE4",
"TT", "B 6F 41um Trace thickness,SE2 L1", "TT",
"B 6F 44.5um Trace thickness,SE2 L1", "TT", "B 7B 85um Trace thickness",
"TT", "B 7F 14um Trace thickness", "TT", "B 8B 18um Trace thickness", "TT",
"B 8F 14um Trace thickness", "TT", "B 8F 18um Trace thickness,SE1", "TT",
"B 8F 28.5um Trace thickness,DE A", "TT", "B 8F 30.5um Trace thickness,SE5",
"TT", "B 9B 90um Trace thickness", "TT", "B 9F 14um Trace thickness", "TT"},
Unmatched( _rcNow )
)},
Update Properties( 1 ),
Target Column( col1 )
);
dt << End Data Update;
Puoi usare la stringa Sostituisci in Recode


E in questo caso sembra che riesca addirittura a creare lavoro
Local({dt, col1},
dt = Data Table("Subset");
dt << Begin Data Update;
col1 = dt << New Column(dt:Chart);
col1 << Set Name("Chart 2");
dt << Move Selected Columns({col1}, after(dt:Chart));
For Each Row(
dt,
col1[] = If(Contains(dt:Chart, "Trace thickness"),
"TT",
dt:Chart
)
);
dt << End Data Update;
);
Puoi modificarlo leggermente se lo desideri
Names Default To Here(1);
dt = Open( "$DOWNLOADS/sample table.jmp" );
dt << select where(Length(:Chart) > Length(Substitute(:Chart, {"Trace thickness", "Trace width", "Insulator thicknes"}, {"", "", ""})));
dt_subset = dt << Subset(Selected Rows, Selected Columns Only(0), Output Table("Subset"));
dt_subset << Begin Data Update;
For Each Row(
dt_subset,
:Chart = If(Contains(dt:Chart, "Trace thickness"),
"TT",
dt:Chart
)
);
dt_subset << End Data Update;