안녕하세요, 제 이름은 Jamal입니다. 저는 말레이시아에서 왔으며 JSL 스크립팅에 대한 지식이 없습니다. 그래서 내 프로젝트는 데이터 웨이퍼에서 여는 모든 테이블에 원치 않는 행과 열이 함께 제공된다는 것입니다. 그래서 내 목표는 이름 행 Parameter 및 other가 새 열인 경우에만 데이터가 작동한다는 것입니다. 또한 사용하지 않은 특정 행을 삭제해야 합니다. 그래서 누군가에게 스크립팅 전문가에게 질문합니다. 데이터 테이블을 선택하면 자동으로 빨간색 마커 안의 다른 행을 삭제하고 행 매개변수를 새 열로 만드는 프로그램을 기록해 둘 수 있습니까?
P/s 모든 데이터 테이블에 동일한 행 매개변수가 있는 것은 아닙니다(44).
Wafer의 데이터 테이블을 넣는 것을 잊었습니다.
이것은 트릭을 할 수 있습니다:
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
문제에 접근하는 방법은 다음과 같습니다.JMP에서 csv 파일을 연 다음 아래 스크립트를 실행합니다.전역 데이터를 테이블 변수에 로드하고 열 이름을 변경한 다음 테스트 열을 숫자 등으로 변환합니다.
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 );
);
);