我需要为目录中的所有文件做四件事:
- 打开数据表
- 添加一列
- 获取该数据表的子集
- 将该子集连接到不同的表
看起来很简单,但我坚持第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));