フォルダ内の定義された数の.jmpファイルの連結1つのフォルダに600,000を超えるjmpデータテーブルがあり、それぞれに12,000行あり、それぞれのファイルサイズは約100kbです。私はこれらすべてをうまく組み合わせることに成功しましたが、驚くことではありませんが、JMPが枯渇して応答しなくなるまでに、最大1500万行のファイル(約1200ファイル)しか生成できません。
このスクリプトを使用して、これらの説明の1つからコピーした操作を実行しました(謝罪、実際の掲示板が見つからなかったため、リンクできません)。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個のセットに移動する方法はありますか?私はいくつか試してみましたが、通常は最初のセットが完了した後に停止します。
よろしく
ダビデ
フォルダ内の定義された数の.jmpファイルの連結これは現在のスクリプトを修正したもので、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 ));