| Home » Products » UltraEdit/UEStudio » Menu Commands (UE) » File | ||||||||||||||||||||||||||
Advanced Sort/Options |
||||||||||||||||||||||||||
|
Article Number: 2231 | Last Updated: Fri, Nov 18, 2011 10:19 AM
|
||||||||||||||||||||||||||
This help topic applies to UltraEdit on Mac/Linux.This command allows you to set the sort options and perform a sort of the active file or all open files. When the sort is executed, a pair of lines are compared as follows: sort compares each pair of fields, in the order specified, according to the associated ordering options, until a difference is found or no fields are left. If no key fields are specified, sort uses a default key of the entire line. Finally, as a last resort when all keys compare equal, sort compares entire lines as if no ordering options other than Reverse Order were specified. The sort process has no limit on input line length or restrictions on bytes allowed within lines. In addition, if the final byte of an input file is not a newline, the sort silently supplies one. A line's trailing newline is not part of the line for comparison purposes. When the Advanced Sort Options command is selected, a dialog is presented with the following options: Sort Using this dropdown users may configure the sort to affect either the Current Document or All Open Documents. Output to New File If this option is selected, the sort results will be written to a new file and the original source file will not be affected by the sort. Merge Sort Results This option is only active if All Open Documents is selected in the Sort dropdown. When selected, this causes all open documents to be sorted and merged into a single result file. Order Using this dropdown, users may specify the sort method used to sort the active file(s). The following options affect the ordering of output lines. They may be specified globally or as part of a specific key field. If no key fields are specified, global options apply to comparison of entire lines; otherwise the global options are inherited by key fields that do not specify any special options of their own. The following options are available:
Details about the Version sort method Version sorting handles the fact that file names frequently include indices or version numbers. Standard sorting usually does not produce the order that one expects because comparisons are made on a character-by-character basis. Version sorting is especially useful when browsing directories that contain many files with indices/version numbers in their names: $ ls -1 $ ls -1v abc.zml-1.gz abc.zml-1.gz abc.zml-12.gz abc.zml-2.gz abc.zml-2.gz abc.zml-12.gz Version-sorted strings are compared such that if ver1 and ver2 are version numbers and prefix and suffix (suffix matching the regular expression '(.[A-Za-z~][A-Za-z0-9~]*)*') are strings then ver1 < ver2 implies that the name composed of “prefix ver1 suffix” sorts before “prefix ver2 suffix”. Note also that leading zeros of numeric parts are ignored: $ ls -1 $ ls -1v abc-1.007.tgz abc-1.01a.tgz abc-1.012b.tgz abc-1.007.tgz abc-1.01a.tgz abc-1.012b.tgz Some suffixes will not be matched by the regular expression mentioned above. Consequently these examples may not sort as you expect: abc-1.2.3.4.7z abc-1.2.3.7z abc-1.2.3.4.x86_64.rpm abc-1.2.3.x86_64.rpm Options
Use Entire Line as Key If this option is selected, the entire line will be evaluated when sorting the file. Individual fields/characters are not used with this option. Keys If preferred, the user may specify keys which determine sorting methods and sorting order. Unless otherwise specified, sorting keys will inherit the global sort options for Ignore Case and Ignore Blanks. Sorting Keys are defined by specifying the following items: Start Field, Start Char., End Field, End Char. Fields and character positions are numbered starting with 1; a character position of zero for End Char. indicates the field's last character. If field values are specified but the start and end character values are not, the sort key will default to the beginning and end of the specified field(s). Keys can span multiple fields. The options Ignore Case, Ignore Blanks, and the sorting method selected are specific to the relevant key. If these options are not specified but the key fields and characters are specified, the specified keys will be sorted using the options specified globally. Pressing the Sort button begins the sorting process using the specified parameters. Depending on the size of the file being sorted, you may notice a prompt indicating that the file is locked for sorting. While the file is being sorted, it is locked and may not be modified. |
||||||||||||||||||||||||||
Attachments
There are no attachments for this article.
|
||||||||||||||||||||||||||
Related Articles
Save As Dialog
Viewed 1293 times since Thu, Oct 20, 2011
Delete Active File command
Viewed 1269 times since Thu, Oct 13, 2011
Close All Files Except This command
Viewed 1182 times since Thu, Oct 13, 2011
ASCII to EBCDIC command
Viewed 1451 times since Thu, Oct 13, 2011
Print Preview command
Viewed 1104 times since Thu, Oct 13, 2011
Favorite Files command
Viewed 1338 times since Thu, Oct 13, 2011
Decrypt File command
Viewed 1298 times since Thu, Oct 13, 2011
Advanced Sort/Options (Windows only)
Viewed 1547 times since Thu, Oct 13, 2011
Recent Projects/Workspace command
Viewed 1075 times since Thu, Oct 13, 2011
Rename File command
Viewed 1249 times since Thu, Oct 13, 2011
|
|
|

English