我需要為目錄中的所有文件做四件事:
- 打開數據表
- 添加一列
- 獲取該數據表的子集
- 將該子集連接到不同的表
看起來很簡單,但我堅持第4步。我可以將原始數據表連接到不同的表中,但不能連接到子集。如何讓jmp使用這個子集?
每個文件都足夠大,我需要在連接操作之前獲取子集。連接所有原始文件會導致jmp崩潰。我需要每週都這樣做,所以我希望有一個腳本來做到這一點。
這就是我所擁有的。
Directory="C:\testpath\testdir\";
FileNames=Files in Directory (Directory);
Summary=New Table("Summary");
For (iFile=1, iFile<=N Items (FileNames), iFile++,
FileString=File Names[iFile];
File_Path=ConCat(Directory,FileString,"\",FileString,".jmp");
One Day Table=Open(File_Path);
New Column("Count Number",Character,Nominal,Formula(Right(:WaferId,2)));
One Day Table << Select Where((Count Number=="01" | Count Number=="08" | Count Number=="15" | Count Number=="22")& Is Missing(Name("SWR::WaferData::SWRNoLEHI1")));
One Day Table Part=One Day Table << Subset (Selected Rows);
FinalTable = Summary << Concatenate(One Day Table Part,OutputTable("Table C"));
close(One Day Table,No Save);
);
我不確定你說的問題到底是什麼,但我注意到你連接到“摘要”表並每次都創建一個新數據。如果您嘗試將部件累積到單個數據表中,則每次都需要連接到該表。您可以使用Concatenate消息上的Append to First Table(1)選項執行此操作。
Summary = New Table( "Summary" );
One Day Table = Open( "$SAMPLE_DATA\Big Class.jmp" );
One Day Table << Select Where( (:Sex == "M") );
One Day Table Part = One Day Table << Subset( Selected Rows );
Summary << Concatenate( One Day Table Part, append to first table(1));
Another Day Table = Open("$SAMPLE_DATA\Fitness.jmp");
Another Day Table << Select Where( (:Sex == "M") );
Another Day Table Part = Another Day Table << Subset( Selected Rows );
Summary << Concatenate( Another Day Table Part, append to first table(1));