There is used in UltraEdit for Windows < v23.20 an internal function for sorting lines which takes horizontal tabs and the configured tab stop value into account. So the sort with the settings to sort according to columns 33 to 36 works with these versions of Windows.
UltraEdit for Windows v23.20 introduced a new sort with much more features using the third-party executable
sort.exe for sorting lines or entire files which is installed with UltraEdit in the subdirectory GNU\sort in the program files directory of UltraEdit. I suggest to look on
More information about the sort function, especially about numeric and column sort and how to sort words on lines and on the power tip
How to sort a text file or CSV file with UltraEdit.
There is now the special sort
Tab delimited sort for a file with tab separated values (TSV files) and a
Custom delimited sort for CSV files using a comma or a semicolon or a vertical bar as separator. But the
Tab delimited sort cannot be used in your case as the tabs are not used to separate the values, but to align the text in the file. So the number of tabs varies between the lines.
The problem here with this text file using horizontal tabs for aligning the text is that the columns are for
sort.exe in real the number of characters in a line. The horizontal tabs are not interpreted as placeholders for 1 to n (8 in your case) spaces as the internal sort of UltraEdit for Windows < v23.20 does. That makes the sort very fast, but makes it not really possible to directly sort files like the attached one using horizontal tabs for text alignment.
For sorting a text file with a varying number of horizontal tabs on each line to align the text in columns according to a specific column range it is necessary with UE v28.10.0.98 to do the following:
- Convert all tabs to spaces in active file or current selection
In ribbon mode click on ribbon tab Format in second group Convert on the second item Tabs / spaces.
In toolbar/menu mode with contemporary menus click in menu Format in the submenu Tabs / spaces on the first menu item Tabs to spaces.
In toolbar/menu mode with traditional menus click in menu Format on the menu item Tabs to spaces.
- Run a column (character count) based sort on entire file or current selection
In ribbon mode click on ribbon tab Edit in last but one group Sort on the down arrow of the item Sort and click in popup menu on the second item Advanced sort/options.
In toolbar/menu mode with contemporary menus click in menu Edit in the submenu Sort on the second menu item Advanced sort/options.
In toolbar/menu mode with traditional menus click in menu File in the submenu Sort on the second menu item Advanced sort/options.
The options to use for your sort based on columns 33 to 36, i.e. just YYMM, are as follows:
Sort order: Ascending
Remove duplicates: unchecked
Ignore case: unchecked
Numeric sort: unchecked
Tab delimited sort: unchecked
Custom delimited sort: unchecked
Key 1: Start column 33 and End column 36
Key 2: Start column 1 and End column 32
Key 3: Start column 0 and End column 0
Key 4: Start column 0 and End column 0
Use locale (slower): unchecked
Key 2 would be with Start column 41 and End column 44 and Key 3 would be with Start column 1 and End column 32 for a sort taking additionally also HHMM into account.
- Convert all series of spaces back to tabs in active file or current selection
In ribbon mode click on ribbon tab Format in second group Convert on the down arrow of the second item Tabs / spaces and click in popup menu on second item Spaces to tabs (all).
In toolbar/menu mode with contemporary menus click in menu Format in the submenu Tabs / spaces on the second menu item Spaces to tabs (all).
In toolbar/menu mode with traditional menus click in menu Format on the menu item Spaces to tabs (all).
Well, in this use case the number of horizontal tabs on the lines to sort is constant for the first six data columns. For that reason it is also possible to use a tab delimited sort with following advanced sort options:
Sort order: Ascending
Remove duplicates: unchecked
Ignore case: unchecked
Numeric sort: unchecked
Tab delimited sort: checked
Custom delimited sort: is grayed out
1. Field: 5 with
Start character 0 and
End character 0
2. Field: 6 with
Start character 0 and
End character 0
3. Field: 1 with
Start character 0 and
End character 0
4. Field: 3 with
Start character 0 and
End character 0
Use locale (slower): unchecked
Start character 0 and
End character 0 means the entire tab separated field value is taken into account for the sort.