[Previous] [Next] [Up] [Top] [Edit]


sorttable - sort a starbase data table on specified columns.


        sorttable [options] < table [keycolumn[:flags]] [keycolumn[:flags]] ...


sorttable uses the unix sort program to sort a starbase data table.

A pair of lines is compared as follows: if any key fields have been specified, sort compares each pair of fields, in the order specified on the command line, according to the associated ordering options, until a difference is found or no fields are left.

If any of the program options Mbdfhinr are given but no key fields are specified, sort compares the entire lines according to the global options.


Program Options

Sort Options


Any of the above sort options may be supplied for specific columns by suffixing the column with a sort flag. Sort flags are introduced by the colon character (":"). Several flags may be given. The flags affect only that column.

In addition a specific subset of characters in a key column may be selected with the column range modifier.

To sort file on column XXX characters 3 through 5 inclusive.

        sorttable XXX+3-5 file


Sort a table by Object name
        john@panic: sorttable < catalog.tab Object > sorted.tab

Sort a table by RA and Dec

        john@panic: sorttable -h < catalog.tab RA Dec > sorted.tab

Sort a table by Object name and then RA position

        john@panic: sorttable < catalog.tab Object -h RA > sorted.tab


[Previous] [Next] [Up] [Top] [Edit]