mm / dd / yyyy 형식으로 텍스트 파일에 저장된 두 개의 날짜가 있습니다. 이 기간에 속하는 데이터를 분석하고 다른 모든 데이터를 삭제해야합니다.
어떻게해야합니까?
다음은 텍스트 파일에서 읽은 날짜를 기반으로 분석을 실행하는 방법의 두 가지 예입니다
Names Default To Here( 1 );
// Create a sample data table
dt = New Table( "Example",
Add Rows( 7 ),
New Column( "ACTUAL_SHORT_DATE",
Numeric,
"Continuous",
Format( "m/d/y", 12 ),
Input Format( "m/d/y" ),
Set Values(
[3612470400, 3614025600, 3618777600, 3614457600, 3613420800,
3578947200, 3613939200]
),
Set Display Width( 154 )
),
New Column( "Sample Data",
Numeric,
"Continuous",
Format( "Best", 12 ),
Set Values(
[0.865467654397147, 0.551025322305757, -0.780534757628151,
0.590164622893679, -0.084595197133406, 0.93192690045854,
-0.652714499840696]
)
)
);
// Read the data from the text file
textValue = Load Text File( "C:\Temp\DateRange.txt" );
// Parse out the start and end dates
startDate = Informat( Word( 1, textValue, " " ) );
endDate = Informat( Word( 2, textValue, " " ) );
// Select the data that falls within the start
// and end dates
dt << select where(
:ACTUAL_SHORT_DATE > startDate & :ACTUAL_SHORT_DATE < endDate
);
// Subset
dtSub = dt << Subset(
Selected Rows( 0 ),
Rows( [2, 4, 5, 7] ),
Selected columns only( 0 )
);
// Analyze the data
dtSub << Bivariate( Y( :Sample Data ), X( :ACTUAL_SHORT_DATE ) );
Names Default To Here( 1 );
// Create a sample data table
dt = New Table( "Example",
Add Rows( 7 ),
New Column( "ACTUAL_SHORT_DATE",
Numeric,
"Continuous",
Format( "m/d/y", 12 ),
Input Format( "m/d/y" ),
Set Values(
[3612470400, 3614025600, 3618777600, 3614457600, 3613420800,
3578947200, 3613939200]
),
Set Display Width( 154 )
),
New Column( "Sample Data",
Numeric,
"Continuous",
Format( "Best", 12 ),
Set Values(
[0.865467654397147, 0.551025322305757, -0.780534757628151,
0.590164622893679, -0.084595197133406, 0.93192690045854,
-0.652714499840696]
)
)
);
// Read the data from the text file
textValue = Load Text File( "C:\Temp\DateRange.txt" );
// Parse out the start and end dates
startDate = Informat( Word( 1, textValue, " " ) );
endDate = Informat( Word( 2, textValue, " " ) );
// Select the data that falls outside the start
// and end dates
dt << select where(
:ACTUAL_SHORT_DATE < startDate | :ACTUAL_SHORT_DATE > endDate
);
// Hide and exclude the selected rows
dt << Hide and Exclude;
dt << clear select;
// Analyze the data
dt << Bivariate( Y( :Sample Data ), X( :ACTUAL_SHORT_DATE ) );
응답 주셔서 감사합니다. 샘플 텍스트 파일을 첨부. 유효한 JMP 날짜 열이 포함 된 jmp 테이블의 모든 데이터가 있습니다.
1. 텍스트 파일 구조는 어떤 모양입니까?
2. 분석 할 데이터가 이미 JMP 데이터 테이블에 있습니까?
삼. 분석 할 데이터에 유효한 JMP 날짜 열이 있습니까?
기본적으로, 당신이 할 일은 텍스트 파일에서 날짜를 읽는 것입니다. 그런 다음 해당 요구 사항을 충족하는 분석 테이블의 모든 행을 찾은 다음 해당 행을 새 데이터 테이블로 하위 집합 화하십시오. 마지막으로 하위 집합 데이터 테이블에서 분석을 실행합니다.
텍스트 파일 및 데이터 파일 / 테이블의 구조에 대한 자세한 내용을 제공 할 수 있다면 솔루션을 찾을 수 있습니다.