SUSORT - sort on any segy header keywords susort stdout [[+-]key1 [+-]key2 ...] Susort supports any number of (secondary) keys with either ascending (+, the default) or descending (-) directions for each. The default sort key is cdp. Note: Only the following types of input/output are supported Disk input --> any output Pipe input --> Disk output Note: If the the CWP_TMPDIR environment variable is set use its value for the path; else use tmpfile() Example: To sort traces by cdp gather and within each gather by offset with both sorts in ascending order: susort OUTDATA cdp offset Caveat: In the case of Pipe input a temporary file is made to hold the ENTIRE data set. This temporary is either an actual disk file (usually in /tmp) or in some implementations, a memory buffer. It is left to the user to be SENSIBLE about how big a file to pipe into susort relative to the user's computer. Credits: SEP: Einar, Stew CWP: Shuki, Jack Caveats: Since the algorithm depends on sign reversal of the key value to obtain a descending sort, the most significant figure may be lost for unsigned data types. The old SEP support for tape input was removed in version 1.16---version 1.15 is in the Portability directory for those who may want to input SU data stored on tape. Trace header fields modified: tracl, tracr