Hallo, mein Name ist Jamal. Ich komme aus Malaysia und habe wirklich keine Kenntnisse über das Skripten von JSL. Mein Projekt ist also, jede Tabelle, die ich von einem Datenwafer öffne, enthält unerwünschte Zeilen und Spalten. Mein Ziel ist also, dass die Daten nur funktionieren, wenn die Namenszeile Parameter und andere eine neue Spalte sind. Außerdem muss ich eine bestimmte Zeile löschen, die ich nicht verwendet habe. Also meine Frage an jemanden, der Skripting-Experte ist. Können Sie das Programm aufschreiben, das, wenn ich eine Datentabelle auswähle, automatisch die andere Zeile innerhalb der roten Markierung löscht und einen Zeilenparameter als neue Spalte erstellt?
P/s nicht jede Datentabelle hat denselben Zeilenparameter (44)
Entschuldigung, ich habe vergessen, die Datentabelle von Wafer hinzuzufügen
Das könnte den Trick machen:
Names Default to Here( 1 );
dt = Current Data Table();
loc = Contains( Column( dt, 1 ) << Get Values, "Parameter" );
dt << Select Rows( 1::loc - 1 ) << Delete Rows;
loc = Contains( Column( dt, 1 ) << Get Values, "PID-1" );
dt << Select Rows( 2::loc - 1 ) << Delete Rows;
For( i = 1, i <= N Col( dt ), i++,
Column( dt, i ) << Set Name( Column( dt, i )[1] )
);
dt << Select Rows( [1] ) << Delete Rows
Hier ist die Art und Weise, wie ich das Problem angehen würde.Öffnen Sie die CSV-Datei in JMP und führen Sie dann das folgende Skript aus.Es lädt die globalen Daten in Tabellenvariablen, ändert die Spaltennamen und konvertiert dann die Testspalten in numerische usw.
Names Default To Here( 1 );
dt = Current Data Table();
// Add Global info as table variables
theRow = 1;
While( Column( dt, 1 )[theRow] != "Parameter",
If( Column( dt, 2 )[theRow] != "",
dt << new table variable( Column( dt, 1 )[theRow],
Column( dt, 2 )[theRow]
)
);
theRow++;
);
// Get rid of unwanted rows
dt << select where( As Column( dt, 3 ) == "" & As Column( dt, 4 ) == "" );
dt << delete rows;
// Rename columns
theRow = (dt << get rows where( As Column( dt, 1 ) == "Parameter" ))[1];
For( i = 1, i <= N Cols( dt ), i++,
If( Column( dt, i )[theRow] != "",
Column( dt, i ) << set name( Column( dt, i )[theRow] )
)
);
dt << delete rows(theRow);
// Attempt to set meta data for columns
// List of know columns
metaList = {
"SBIN", "numeric", "ordinal",
"HBIN", "numeric", "ordinal",
"DIE_X", "numeric", "ordinal",
"DIE_Y", "numeric", "ordinal",
"SITE", "numeric", "ordinal",
"TOTAL_TESTS", "numeric", "continuous",
"X", "numeric", "ordinal",
"Y", "numeric", "ordinal",
"SITE_NO", "numeric", "ordinal",
"PassFail", "numeric", "ordinal",
"TimeStamp", "numeric", "timestamp",
"PartSN", "character", "nominal"
};
// Process metaList into separate lists for easier processing
colList = {};
typeList = {};
modelList = {};
For( i = 1, i <= N Items( metaList ), i++,
If(
Mod( i, 3 ) == 1, Insert Into( colList, metaList[i] ),
Mod( i, 3 ) == 2, Insert Into( typeList, metaList[i] ),
Insert Into( modelList, metaList[i] )
)
);
For( i = 1, i <= N Cols( dt ), i++,
foundName = Contains( colList, Column( dt, i ) << get name );
If(
foundName,
If(
Contains( {"ordinal", "nominal", "continuous"}, modelList[foundName] ),
Column( dt, i ) << dataType( typeList[foundName] ) << modelingtype( modelList[foundName] ),
modelList[foundName] == "timestamp",
For( k = 1, k <= N Rows( dt ), k++,
Column( dt, i )[k] = Word( 1, Char( Column( dt, i )[k] ), "_ " ) || "/" || Word( 2, Char( Column( dt, i )[k] ), "_ " ) || "/"
|| Word( 3, Char( Column( dt, i )[k] ), "_ " ) || " " || Word( 2, Char( Column( dt, i )[k] ), " " )
);
Column( dt, i ) << datatype( numeric ) << modelingtype( continuous ) << set informat( "y/m/d h:m:s" ) <<
Format( "y/m/d h:m:s", 18, 0 );,
),
Is Missing( Num( Column( dt, i )[1] ) ) == 0,
Column( dt, i ) << datatype( numeric ) << modelingtype( continuous );
);
);