데이터를 열로 구문 분석한 다음 여러 특수 문자로 스택하려면 어떻게 해야 합니까?특수 문자가 많은 열에 텍스트를 입력해야 하는 원시 데이터가 있습니다. 그런 다음 스택합니다. 일반적인 경우에 대한 JSL 스크립트로 솔루션을 제공해 주시겠습니까? 자세한 내용은 내 Excel 파일을 참조해 주세요.
자동화 및 스크립팅Re: 데이터를 열로 구문 분석한 다음 여러 특수 문자로 스택하는 방법짐, 당신의 해결책에 정말 감사드려요.
틴
Re: 데이터를 열로 구문 분석한 다음 여러 특수 문자로 스택하는 방법여기 제 첫 번째 패스 스크립트가 있습니다. 이 접근 방식은 전체 데이터 테이블에서 조정해야 할 사항을 확인하는 데 필요한 내용을 제공해야 합니다.
Names Default To Here( 1 );
dt = Current Data Table();
// Create the new columns
dt << New Column( "domain_frequency_core", character );
dt << New Column( "Data" );
// Create the static part for the column domain_frequency_core
startString = "Data@" || Word( 1, :string_result[1], ":" );
// Read into a memory variable the entire string, minus the startString component
theString = Word( 2, :string_result[1], ":_" );
// Initialize the looping variables
outerLoop = 1;
theRow = 0;
// Loop through the major groupings in the data
While( Word( outerLoop, theString, "%" ) != "",
// Strip off the subpart of the string
majorWord = Word( outerLoop, theString, "%" );
// Get the second component of the start string
startStringSuffix = "@" || word(1,majorWord,"^") || "@";
// Initialize the inner loop value, starting with word 2
innerLoop=2;
// Loop through the subgroup finding each numeric component
While( word(innerLoop, majorWord, "^V") != "",
// Add a new row
if(theRow !=0, dt<<ADD rows=""></ADD>
<P><SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="txnelson_0-1712831359209.png" style="width: 668px;"><span class="lia-inline-image-display-wrapper" image-alt="txnelson_0-1712831359209.png" style="width: 668px;"><img src="https://us.v-cdn.net/6038925/uploads/images/63259i1123569D89D26136/txnelson_0-1712831359209.png" width="668" height="330" role="button" title="txnelson_0-1712831359209.png" alt="txnelson_0-1712831359209.png" /></span></SPAN></P>
<P> </P>Re: 데이터를 열로 구문 분석한 다음 여러 특수 문자로 스택하는 방법안녕하세요 짐,
제 데이터를 오해하신 듯합니다. 당신이 쓴 코드는 출력입니다.
"원시 데이터" 시트를 참조해 주세요.

"구문 분석 후 데이터" 시트에서 출력이 예상됩니다.

미리 감사드립니다.
Re: 데이터를 열로 구문 분석한 다음 여러 특수 문자로 스택하는 방법다음은 원래 데이터 테이블을 가져와 대상 열을 분할한 다음 결과를 쌓는 스크립트입니다. 분할된 열 중 일부는 문자열 데이터로만 구성되고 일부는 숫자 값으로 보이기 때문에 모든 열을 쌓는 것은 원하는 것이 아닌 듯합니다.
Names Default To Here( 1 );
dt = Current Data Table();
targetCol = "domain_frequency_core";
// Text to columns
Data Table( "Book1 (4)_Sheet1" ) <<
Text to Columns( columns( Column( targetCol ) ), Delimiters( "@" ) );
// Get list of all target columns except original column
stackList = Filter Each( {name}, dt << get column names( string ),
Contains( name, targetCol ) & name != targetCol
);
// Stack the new columns
dt << Stack(
columns( stackList ),
Source Label Column( "Label" ),
Stacked Data Column( "Data" ),
Output Table( "Final Stacked Data Table" )
);
스크립트를 공부할 시간을 내주세요. 사용된 모든 기능과 플랫폼은 스크립팅 인덱스와 JMP 도움말 화면에 문서화되어 있습니다.