jsl을 사용하여 1개 열의 문자열을 어떻게 구문 분석할 수 있나요?jsl을 사용하여 구분 기호 "|"를 사용하여 "result" 열의 데이터를 분할하고 싶습니다. 새 열 "PIN" 및 "값"으로. 친절하게 도와주세요. 미리 감사드립니다.
첨부파일을 참조해주세요

새 테이블

자동화 및 스크립팅Re: jsl을 사용하여 1개 열의 문자열을 어떻게 구문 분석할 수 있나요?- Replace the Stack code with this
// Get all of the column names
resultList = dt << get column names();
// Only the columns Result 2 thru Result N are to be
// stacked, so remove the first 3 columns from the list
remove from(resultList,1,3);
// Use a multiple series stack to stack the data
dtStack = dt << Stack(
columns( resultList ),
Source Label Column( "Label" ),
Stacked Data Column( "Data" ),
"Non-stacked columns"n( Keep( :Unit#, :Result 1 ) ),
Number of Series( 2 ),
Output Table( "Untitled 20.jmp" )
);
- 도움말 풀다운 메뉴에 있는 JMP 문서 라이브러리에서 스크립팅 가이드를 읽어보세요.
Re: jsl을 사용하여 1개 열의 문자열을 어떻게 구문 분석할 수 있나요?// Use a multiple series stack to stack the data
dtStack = dt << Stack(
columns( :Result 2, :Result 3, :Result 4, :Result 5, :Result 6, :Result 7 ),
위 단계에서 내 데이터 세트가 결과 120까지 너무 많은 결과를 반환하고 결과 차이가 120보다 클 수 있는 경우 Jim 데이터를 스택하기 위해 jsl 스크립트를 코딩할 수 있는 방법이 있습니까?
Re: jsl을 사용하여 1개 열의 문자열을 어떻게 구문 분석할 수 있나요?Jim에게 정말 감사드립니다. 아주 좋은 해결책입니다.
Re: jsl을 사용하여 1개 열의 문자열을 어떻게 구문 분석할 수 있나요?정말 고마워
Re: jsl을 사용하여 1개 열의 문자열을 어떻게 구문 분석할 수 있나요?데이터 테이블이 주어지면

이 JSL은 필요한 새 테이블을 생성합니다.
names default to here(1);
// Create a handle to point to the data table in question
dt = current data table();
// Convert the Result column into several columns
// Text to columns
dt << Text to Columns(
columns( :Result ),
Delimiters( "|" )
);
// Use a multiple series stack to stack the data
dtStack = dt << Stack(
columns( :Result 2, :Result 3, :Result 4, :Result 5, :Result 6, :Result 7 ),
Source Label Column( "Label" ),
Stacked Data Column( "Data" ),
"Non-stacked columns"n( Keep( :Unit#, :Result 1 ) ),
Number of Series( 2 ),
Output Table( "Untitled 20.jmp" )
);
// Delete unneeded columns
dtStack << delete columns(:Label,:Label2);
// Rename the stacked columns
dtStack:Result 1 << set name ("Number Of Tests");
dtStack:Data << set name("PIN");
dtStack:Data2 << set name("Value");

위의 JSL은 모두 Text to Columns, Stack 및 Column 이름 변경 등을 대화식으로 실행한 다음 JMP 로그로 이동하여 JMP가 생성한 JSL을 잘라내어 스크립트 창에 붙여넣는 방식으로 생성되었습니다. 좀 더 보기 좋게 만들기 위해 JSL을 잘라서 붙여넣은 것을 정리하는 방법을 고백하겠습니다.
Re: jsl을 사용하여 1개 열의 문자열을 어떻게 구문 분석할 수 있나요?데이터 테이블 열을 여러 열로 분할(jmp.com)
열을 선택하세요

열 메뉴로 이동

구분 기호를 설정하세요

확인을 누르면 결과가 나옵니다

향상된 로그/워크플로에서 스크립트를 복사하고 필요에 따라 수정합니다.
// Text to columns
Data Table("Sheet1") << Text to Columns(columns(:Result), Delimiters("|"));