나는 하나의 폴더에 600,000 개 이상의 jmp 데이터 테이블을 가지고 있으며 각각에 12,000 개의 행이 있으며 각 파일의 파일 크기는 ~ 100kb입니다. 나는이 모든 것들을 연결하기 위해 성공하지 않고 노력했지만 놀랍지 않게 JMP가 스팀을 다 써 버리지 않고 응답이 없기 전에 ~ 15million 행 (약 1200 개의 파일)의 파일 만 생성 할 수 있습니다.
이 스크립트를 사용하여이 토론 중 하나에서 복사 한 작업을 수행했습니다 (사과하지만 실제 보드를 찾을 수 없으므로 링크 할 수 없음). 1,000 개의 파일을 개별 폴더에 복사 한 다음 연결을 설정할 수는 있지만 다소 지루한 작업입니다.
mypath = Pick Directory( "Select a directory" );
Set Current Directory( mypath );
y = Files In Directory( mypath );
For( i = N Items( y ), i > 0, i--,
If( Ends With( y[i], "jmp" ),
,
Remove From( y, i )
)
);
n = N Items( y );
For( i = 1, i <= N Items( y ), i++,
sname = Left( y[i], Length( y[i] ) - 4 );
/* If the file is the first in the list, open it. Otherwise, open the table, concatenate with the main table, and close the table just opened. */
If( i == 1,
mainDt = Open( mypath || y[i] );
mainDt << New Column( "source", character, set each value( sname ) );
,
dt = Open( mypath || y[i], hidden, invisible );
dt << New Column( "source", character, set each value( sname ) );
mainDt = mainDt << Concatenate( dt, Append to First Table );
Close( dt, NoSave );
Wait( 0 );
);
);
/* Give the final table a name. */
mainDt << Set Name( mypath, "_Concatenated Files" );
dt << Save( mypath, "_Concatenated Files" );
이 추가 기능은 작동하지 않습니다. https://community.jmp.com/t5/JMP-Add-Ins/Bulk-Concatenate-Add-in/ta-p/35435
첫 번째 1000 개의 파일 만 연결하고, 연결된 테이블을 저장 한 다음 닫고, 다음 1,000 개의 파일로 이동하는 방법이 있습니까? 나는 몇 가지 시도를 해봤지만 첫 세트가 완료된 후 대개 막을 수 있습니다.
문안 인사
데이비드
다음은 현재 스크립트에 수정 된 내용으로 1000 개 파일을 모두 연결 파일에 저장합니다. 새 스크립트에서 몇 번 "mypath"와 "_Concatenated Files"문자열을 올바르게 연결하지 않은 오류도 수정했습니다. 또한 Save 문에서 잘못된 데이터 테이블을 가리켜 저장하려고했습니다.
mypath = Pick Directory( "Select a directory" );
Set Current Directory( mypath );
y = Files In Directory( mypath );
For( i = N Items( y ), i > 0, i--,
If( Ends With( y[i], "jmp" ),
,
Remove From( y, i )
)
);
n = N Items( y );
counter=0;
For( i = 1, i <= N Items( y ), i++,
sname = Left( y[i], Length( y[i] ) - 4 );
/* If the file is the first in the list, open it. Otherwise, open the table, concatenate with the main table, and close the table just opened. */
If( counter == 0,
mainDt = Open( mypath || y[i] );
mainDt << New Column( "source", character, set each value( sname ) );
,
dt = Open( mypath || y[i], hidden, invisible );
dt << New Column( "source", character, set each value( sname ) );
mainDt = mainDt << Concatenate( dt, Append to First Table );
Close( dt, NoSave );
Wait( 0 );
);
counter = counter + 1;
If(mod(counter,1000) == 0,
mainDt << Set Name( mypath || "_Concatenated_Files_" || char(i) || "_" || char(i+counter) );
mainDt << Save( mypath || "_Concatenated_Files_" || char(i) || "_" || char(i+counter) );
counter = 0;
)
);
/* Give the final table a name. */
mainDt << Set Name( mypath || "_Concatenated_Files_" || char(i) || "_" || char(i+counter) );
mainDt << Save( mypath || "_Concatenated_Files_" || Char( i ) || "_" || Char( i + counter ));