찾아서 바꿀 스크립트피크 면적 수가 포화 될 때 "포화 (####)"를 추가하는 GCMS 프로그램을 사용합니다.이 결과를 Excel에서 JMP 데이터 테이블로 내 보낸 후 이러한 발생을 찾아 "포화 ()"를 제거하지만 숫자를 연속적인 12,0 형식으로 남겨 두는 스크립트를 실행하고 싶습니다.
스크립팅Re : 찾기 및 바꾸기 스크립트대화식으로 찾기 기능을 사용하여 "("및 ")"의 전역 대체를 수행하는 것은 매우 쉽습니다.그런 다음 Standardize Attributes를 사용하여 문제의 모든 열을 선택하고 숫자, 연속, 형식 (Fixed Dec, 12,0)으로 변경할 수 있습니다.
찾기는
편집 => 검색 => 찾기
데이터 테이블의 경우 왼쪽 열 패널의 빨간색 삼각형 아래에서 특성 표준화를 사용할 수 있습니다.
다음은 트릭을 수행하는 작은 스크립트이지만 데이터 테이블이 크면 느릴 수 있습니다.
Names Default To Here( 1 );
dt = Current Data Table();
// Get all character columns
colList = dt << get column names( character, string );
// Loop across all character columns and find those who have the pattern (###)
// and if found, then convert all columns
For( I = 3, i <= N Items( colList ), i++,
If( Left( char(Column( dt, colList[i] )[1]), 1 ) == "(" & Right( char(Column( dt, colList[i] )[1]), 1 ) == ")",
For( k = 1, k <= N Rows( dt ), k++,
If( Left( (Column( dt, colLIst[i] )[k]), 1 ) == "(",
Column( dt, colList[i] )[k] = Substr( Column( dt, colList[i] )[k] ,
2)
);
If( Right( (Column( dt, colList[i] )[k]), 1 ) == ")",
Column( dt, colList[i] )[k] = Word( 1, Column( dt, colList[i] )[k], ")" )
);
);
// Convert to numeric, etc.
Column( dt, colList[i] ) << data type( numeric ) << modeling type( continuous ) <<
Format( "Fixed Dec", 12, 0 );
)
);Re : 찾기 및 바꾸기 스크립트대본 감사합니다.하지만 제가 충분히 구체적이지 않은 것 같습니다.대본 작성은 저에게 매우 새롭고 숫자의 길이는 중요하지 않다고 생각했습니다.나는 그것이 틀렸다고 생각한다.나는 대본을 가지고 놀았지만 "saturated (635403558)"를 635403558로 바꾸지 못했습니다.도와 주셔서 감사합니다.
Re : 찾기 및 바꾸기 스크립트스크립트는 "("가 첫 번째 문자이고 ")"가 마지막 문자가 될 것으로 예상합니다.공백 문자가 시작 또는 끝에있을 수 있습니까?
이 버전의 스크립트를 시도하고 도움이되는지 확인하십시오.
Names Default To Here( 1 );
dt = Current Data Table();
// Get all character columns
colList = dt << get column names( character, string );
// Loop across all character columns and find those who have the pattern (###)
// and if found, then convert all columns
For( I = 1, i <= N Items( colList ), i++,
If( Left( Trim( Char( Column( dt, colList[i] )[1] ) ), 1 ) == "(" & Right( Trim( Char( Column( dt, colList[i] )[1] ) ), 1 ) == ")",
For( k = 1, k <= N Rows( dt ), k++,
If( Left( (Trim( Column( dt, colLIst[i] ) )[k]), 1 ) == "(",
Column( dt, colList[i] )[k] = Substr( Trim( Column( dt, colList[i] )[k] ), 2 )
);
If( Right( Trim( Column( dt, colList[i] )[k] ), 1 ) == ")",
Column( dt, colList[i] )[k] = Word( 1, Column( dt, colList[i] )[k], ")" )
);
);
// Convert to numeric, etc.
Column( dt, colList[i] ) << data type( numeric ) << modeling type( continuous ) << Format( "Fixed Dec", 12, 0 );
)
);Re : 찾기 및 바꾸기 스크립트내가 올바르게 이해한다면 이것은 사용할 기회가 될 수 있습니다. JMP의 패턴 매칭 (감사합니다 안녕하세요.
:(:(
NamesDefaultToHere(1);
// Define a function
removeSaturated =
Function({inStr}, {Default Local},
// A pattern that will match a span of digits, with or without a leading '-'
digits = (""|"-") + patSpan("0123456789");
// Put the match into 'found' (might be identical to 'inStr')
patMatch(inStr, digits >? found);
// Return 'found' as a number
Num(found);
);
// Try it out
Print(removeSaturated("saturated( 635403558 )"));
Print(removeSaturated("saturated(635403558)"));
Print(removeSaturated("635403558"));
Print(removeSaturated("635403"));
Print(removeSaturated("-635403"));
Print(removeSaturated("saturated( -635403 )"));
Re : 찾기 및 바꾸기 스크립트슬프게도 스크립트를 실행할 때 아무 일도 일어나지 않았습니다.도움이된다면 열 속성과 함께 내 데이터의 스크린 샷을 포함했습니다.다시 한 번 감사드립니다!

Re : 찾기 및 바꾸기 스크립트당신의 지역 열에 이것을 시도하십시오
Names Default To Here( 1 );
dt = Current Data Table();
// Loop across all character columns and find those who have the pattern (###)
// and if found, then convert all columns
For( k = 1, k <= N Rows( dt ), k++,
If( Contains( :Area[k], "(" ),
:Area[k] = Word( 2, :Area[k], "()" )
)
);
:Area << data type( numeric ) << modeling type( continuous ) << Format( "Fixed Dec", 12, 0 );