I need to do four things for all files in a directory:
- Open a data table
- Add a column
- Take a subset of that data table
- Concatenate that subset onto a different table
Seems so simple, but I get stuck on step 4. I can concatenate the original data table into the different table, but not the subset. How do I get jmp to work with this subset?
Each file is large enough that I need to take the subset before the concatenation operation. Concatenating all the whole original files leads to jmp crashing. I need to do this every week, so I am hoping for a script to do this.
Here's what I have.
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);
);