Below is an example that should give you an idea of how to approach this issue. You will probably need to make changes to it based upon the details of what your actual structures are
Names Default To Here( 1 );
// get the workbooks to be processed
theFiles = Files in Directory(<your path>, recursive(1) );
// reduce the list to only .xlsx entries
For( i = N Items( theFiles ), i >= 1, i--,
If( Word( -1, theFiles[i], "." ) != "xlsx",
Remove From( theFiles, i, 1 )
)
);
// create the base data table that all other tables will be concatenated to
dtFinal = New Table( "All Data" );
// loop through all .xlsx files and concatenate them to dtFinal
// the Concatenate Worksheets(1) will result in a single data table
// for each workbook read in and that single data table will be concatenated
// to the dtFinal
For( i = 1, i <= N Items( theFiles ), i++,
dt = Open(
theFiles[i],
Use for all sheets( 1 ),
Concatenate Worksheets( 1 ),
Create Concatenation Column( 0 ),
Worksheet Settings(
1,
Has Column Headers( 1 ),
Number of Rows in Headers( 1 ),
Headers Start on Row( 1 ),
Data Starts on Row( 2 ),
Data Starts on Column( 1 ),
Data Ends on Row( 0 ),
Data Ends on Column( 0 ),
Replicated Spanned Rows( 1 ),
Replicated Spanned Headers( 0 ),
Suppress Hidden Rows( 1 ),
Suppress Hidden Columns( 1 ),
Suppress Empty Columns( 1 ),
Treat as Hierarchy( 0 ),
Multiple Series Stack( 0 ),
Import Cell Colors( 0 ),
Limit Column Detect( 0 ),
Column Separator String( "-" )
)
);
// concatenate the new table with the dtFinal table
dtFinal << concatenate( dt, append to first table( 1 ) );
// delete the no longer needed data table dt
Close( dt, nosave );
);
Jim