next up previous contents
Next: Classifying a data frame Up: Data reorganization Previous: Picking data records based

Sorting a data frame

 

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


next up previous contents
Next: Classifying a data frame Up: Data reorganization Previous: Picking data records based

Anssi Lensu
Tue Jul 23 11:58:18 EET DST 2002