vEdit has both a sort function EDIT > Sort > Sort lines for sorting lines (single line records), and the SORTMAIL macro for sorting records consisting of multiple lines. Both support variable-length and fixed-length records.
The EDIT > Sort > Sort lines function sorts all lines in the entire file or just in the highlighted block. It first displays a dialog box with sort options and an input box for entering the columns for the primary “sort key”, and optionally, for up to nine secondary key fields (column ranges).
If no block is highlighted, the default is to sort the entire file with a sort key beginning in column one. If a columnar block is highlighted, the default is to sort only the lines within the block, using the highlighted columns as the sort key.
Options include ascending/descending, case-sensitive, and disabling the current “ collate table ”. A collate table is normally used to set the sort order of special characters. For example, the default table equates spaces and Tab characters, and sorts European characters, such as “u umlaut” immediately after “u”. Collate tables are described in detail below.
vEdit’s sorting speed is among the fastest in the industry. A 100-megabyte file can be sorted in about three minutes on a typical 1-GHz computer. When sorting a huge file we highly recommend that the file reside on the local hard disk and not on a network server.

You can easily sort an entire file or all lines in a block according to a “key” field such as the “Last-name” or “Zipcode” in a database.
Sorting must sometimes be based on multiple fields. For example, you might want to sort by “Zipcode” and within the same “Zipcode”, sort by “Last-name”, and within the same “Last-name”, sort by “First-name”. vEdit easily performs such sorts in one operation.
If it is a large file, vEdit will display its progress.