mTblSort

Description:
Sorts a table on numeric values.
Syntax:
mTblSort [-d] in.tbl colname out.tbl

Switches:

-d
Turns on debugging

Arguments:

in.tbl
Path to input table
colname
Name of column to sort on (column must contain numeric values)
out.tbl
Path to output table
Results:
[struct stat="OK", count=nrows]
where nrows is the number of rows in the table.

Examples

$ mTblSort images.tbl ra ra_sorted.tbl
[struct stat="OK", count=5, nmatches=3]

ra_sorted.tbl is now sorted on the column "ra".

Return Codes:

  • [struct stat="OK", count=nrows]
  • [struct stat="ERROR", msg="Usage: mTblSort [-d] in.tbl colname out.tbl]
  • [struct stat="ERROR", msg="Cannot allocate memory for data"]
  • [struct stat="ERROR", msg="Cannot open input file"]
  • [struct stat="ERROR", msg="Cannot open output file"]
  • [struct stat="ERROR", msg="Table file open failed for [in.tbl]"]
  • [struct stat="ERROR", msg="Table file does not have fixed-length records"]
  • [struct stat="ERROR", msg="Table does not contain column [colname]"]