Next Previous Up Contents
Next: Mode Specifier
Up: Arguments
Previous: Input Specifier

B.3.3.2 Filter Specifiers

The filter specifiers each specify a processing step which is performed on a table, transforming an input table to an output one. You can have any combination of them, and they are used in the order that they are given on the command line. They are like filter-type commands in a Unix pipeline. Some of them have additional optional or mandatory arguments.

-select <expr>
Include in the output table only rows for which the given expression <expr> evaluates to true. The syntax is like in TOPCAT, as described in SUN/253. Columns can be addressed by name (if the name is syntactically a java identifier) case-independently, or as $n, where n is the column index. $1 is the first column. $0 is the row index (starting at 1).
-sort [-down] [-nullsfirst] <colid-list>
Sorts the table according to the columns named in <colid-list>. <colid-list> is a space-separated list of column identifiers (names, $identifiers or numbers, where 1 is the first column). One or more columns may be specified: sorting is done on the values in the first-specified field, but if they are equal the tie is resolved by looking at the second-specified field, and so on. If the -down flag is used, the sort order is descending instead of ascending. If the -nullsfirst flag is used, blank entries are considered to come at the start of the collation sequence instead of the end.
-sortexpr <expr>
Sorts the table according to the value of an algebraic expression.
-every <step>
Include only every <step>'th row, starting with the first row.
-head <nrows>
Include only the first <nrows> rows of the table.
-tail <nrows>
Include only the last <nrows> rows of the table.
-addcol [-after <col-id> | -before <col-id>] <col-name> <expr>
Add a new column called <col-name> defined by the algebraic expression <expr>. Expression syntax is as for the -select flag. By default the new row appears after the last row of the table, but you can position it using either the -after or -before flags. In either case, identify a column using its name (if it is syntactically a java identifier), or its number (the first column is 1), or its $identifier ($1 is the first column).
-keepcols <colid-list>
Output table consists of only those columns named in <colid-list>, in that order. <colid-list> is space-separated. Column identifier syntax is as for -addcol flag.
-delcols <colid-list>
Delete named columns. <colid-list> is as for -keepcols flag.
-explode
Turns any column which is an N-element array into N scalar columns.
-cache
Stores in memory or on disk a temporary copy of the table at this point in the pipeline. This can provide improvements in efficiency if there is an expensive step upstream and a step which requires more than one read of the data downstream.
-random
Only useful for debugging.
-sequential
Only useful for debugging.


Next Previous Up Contents
Next: Mode Specifier
Up: Arguments
Previous: Input Specifier

STIL - Starlink Tables Infrastructure Library
Starlink User Note 252
STIL web page: http://www.starlink.ac.uk/stil/
Author email: m.b.taylor@bristol.ac.uk
Starlink: http://www.starlink.ac.uk/