vEdit uses a "collate table” to control the order in which characters are sorted. This is much more flexible than the typical sort utility that simply orders all characters by their hex value.
For example, by modifying the collate table, you could have vEdit:
- Sort digits before or after letters.
- Sort punctuation before or after letters.
- Fully control how European characters are sorted; correctly sort any character set (code page).
vEdit is supplied with these collate tables:
- COLLANSI.TBL
- This collate table equates Tabs, Spaces and Nulls; the sort order is punctuation, digits, letters, followed by graphics (8th-bit) characters. It sorts European characters, e.g. “um-laut-u” after “u” according to the ANSI character set.
- COLLOEM.TBL
- This collate table is identical to collansi.tbl, except that it sorts European characters according to the OEM character set.
- COLLEBC.TBL
- This collate table is designed for EBCDIC (mainframe) files.
- COLLDEF.TBL
- This is the default collate table which is automatically loaded if no other table is explicitly loaded. By default it is a copy of collansi.tbl since most Windows programs use the ANSI character set. If you usually work with the OEM character set, you can copy colloem.tbl to colldef.tbl.
If you need to load a different collate table, you can manually load it from within vEdit or have vEdit automatically load it at startup.
Manually Load a Collate Table
- Select Edit > Sort > Sort Lines
- In the sort dialog box, click the Load table... button. In the file dialog box, select the desired collate table.
- Upon returning to the sort dialog box, you should see the name of the new collate table in the title.
- Click Cancel to return to normal editing or click OK to immediately sort using the new collate table.
Automatically Load a Collate Table at Startup
vEdit can automatically load a collate table at startup. The online help topic “STARTUP.VDM and USTARTUP.VDM Files” describes the startup process in detail.
- Open the file ustartup.vdm in the User Config Directory for editing.
- ocate the line: // Sort_Load("COLLDEF.TBL") ...
- Delete the leftmost “//” to enable the command.
- Change the “COLLDEF.TBL” to the desired filename.
- Enable CONFIG > Misc > Enable USTARTUP.VDM file.
- Select CONFIG > Save config to ensure this setting is saved into the vedit.cfg file.
- Save the file and exit vEdit.
- Restart vEdit and select EDIT > Sort > Sort lines.
- You Should see the name of the new collate table in the title, click Cancel.
Creating Your Own Collate Tables
Custom collate tables can be created from “source” text files. The source to the supplied collate tables is included in the files collansi.txt, colloem.txt and collebc.txt. The file closest to your needs should be used as a model. The supplied collate.vdm macro is then used to convert (compile) the source collate table .TXT file into the binary .TBL file.
Create a Custom Collate Table
- Select the closest “source” collate table COLLxxxx.TXT file and open it in vEdit.
- Select FILE > Save as and enter a suitable name for the new source table, e.g. “collnew.txt”.
- Edit the source collate table to create the desired sort order. Refer to the file collate.vdm for detailed information about the syntax and commands in these source files.
- Select FILE > Save to save your changes.
- Select MISC > Load/execute macro and select the collate.vdm macro.
If necessary, correct any mistakes that this macro reports.
When the source collate table is error free, the macro will create a binary. TBL file, e.g. it will create collnew.tbl
As described above, you can then manually load or automatically load the new collate table.
Related Resources