I have a large number of CSV files (with same columns but different number of rows) in a folder and would like to concatenate them all. However, I need to delete 5 rows from end of each table before concatenating them. I would appreciate any help with writing the appropriate JSL code to do this job.
Here is a simple script that will concatenate all open data tables after deleting the last 5 rows in each table.
Names Default To Here( 1 );
tableList = {};
For( i = 1, i <= N Table(), i++,
Data Table( i ) << delete rows(
Index( N Rows( Data Table( i ) ) - 4, N Rows( Data Table( i ) ) )
);
Insert Into( tableList, Data Table( i ) << get name );
);
dt = New Table( "All Tables" );
For( i = 1, i <= N Items( tableList ), i++,
dt << concatenate( Data Table( tableList[i] ), append to first table( 1 ) )
);