Hello Jim,
Thanks for the help, I figured that out after several tries. I should have replied back that thread. The below was the code I used. The problem I have now is that I cannot join more that 2 tables together. Every time I try to join 3 tables, it shows out 2 different concatenated tables instead of one. The first one shows concatenated data table 1 and 2 and the second shows concatenated data table 1 and 3.
Without one concatenated data table, it's very hard to use the column copier. So I was thinking instead, is it possible to use the column copier so it shows all columns from multiple data tables?
Names Default To Here( 1 );
// Use 'PickFile()' to get a list of files to open (Windows only)
fileList = Pick File(
"Select one of more files", // Prompt
"$DESKTOP", // Initial folder
{"JMP Files|jmp;jsl;jrn;csv", "All Files|*"}, // List of file filters to apply (ignored by OS/X)
1, // Initial file filter to apply (index of item in the list above)
0, // Save flag - Specify either a 'Save' or 'Open' window. Set a value of 1 or 0 respectively.
Empty(), // Default file
multiple// Multiple - allows more than one file to be opened (ignored by OS/X)
);
// If only a single file is selected, fileList will not be a list, so we need to build it for ourselves
If( !Is List( fileList ),
fileList= Eval List( {fileList} )
);
// Open the files and store their corresponding JMP table names
tableNames = {};
For( f = 1, f <= N Items( fileList ), f++,
dttemp= Open( fileList[f] );
Insert Into( tableNames, dttemp << getName );
// Append the data tables together
If( f == 1,
dt= dttemp,
dtx = dt<< Join ( With ( dttemp ), By Row Number, By Matching Columns (name=name),Preserve Main Table Order(), Output table name("Concatenated Watch H") );
Close( dttemp, nosave );
dt = dtx;
);
);
dt = Current Data Table();
//Create Column Copier to copy files
col_dlg = New Window( "Column Copier",
Panel Box( "Select four columns to create a new table with:",
col_clist = Col List Box( all, width( 200 ), max selected( 4 ) ),
),
Button Box( "OK",
selected_column_list= col_clist << getselected;
col1= selected_column_list[1];
col2= selected_column_list[2];
col3= selected_column_list[3];
col4= selected_column_list[4];
// Create a new table using just the two selected columns
dt2= dt << Subset( columns( Column( dt, col1 ), Column( dt, col2 ), Column( dt, col3 ), Column( dt, col4 ) ) );
col_dlg<< close window;
)
);