sort | Sort the records of a data frame |
-k <keydata> | key fields for sorting |
-d <data> | actual data fields to be sorted |
-dout <trgdata> | target data, which can also be the same as source data |
[-desc] | descending order |
This operation sorts the given data frame, <data>, according to the keys in <keydata>. If result data is the same as <data>, then <data> is replaced with the sorted data. Otherwise, a new data frame is created.
Example (ex3.4): Here are two sorting examples for data frames.
... # Ascending according to rate, replacing source with result NDA> select key1 -f boston.rate NDA> sort -k key1 -d boston -dout boston # Two fields as keys, priorities: 1. dis, 2. rm NDA> select key2 -f boston.dis boston.rm NDA> sort -k key2 -d boston -dout boston2