To delete rows, send a Delete Rows message and specify which row or rows to delete. To delete more than one row, give a list or matrix as the rownum argument, or combine Delete Rows with other commands such as For. The rownum argument can be a number, list of numbers, range of numbers, matrix, or an expression that yields one of these. Without an argument, Delete Rows returns the number of selected rows and deletes those rows. When an argument is not specified or rows are not selected, Delete Rows only returns the number of selected rows: 0.
Here is a general way to remove the bottom x rows of a data table of any size. The following example removes five rows from the bottom of the data table:
x = 5;
n = N Row( dt );
For( i = n, i > n - x, i--,
dt << Delete Rows( i )
NRow counts the rows in the table. For more details, see Iterate a Script on Each Row.