KEDIT Hints and Tips: Column Markers

When working with a text file you sometimes need to enter data at a specific column location. As an example, the file below contains pairs of X,Y coordinates:

Suppose you need to place the word "yes" beginning in column 50 for each X coordinate that is negative. When doing this it would be helpful to have some sort of indicator as to where this specific column is. You could move the cursor around and rely on the "Col=" indicator on the KEDIT for Windows status line but this can become tedious if you are continually repositioning the cursor to do other editing. You could turn on the scale line but this is most useful only if the line you are working on is close to the scale line. You need something that clearly indicates the column at all times.

The KEDIT SET COLMARK command works perfectly for this situation. SET COLMARK allows you to specify one or more column numbers and KEDIT displays a thin vertical line at the left edge of each of these positions. This vertical line is not part of the file though; it's there as a visual aid much like the thin horizontal lines that appear above and below the current line when the cursor is on the command line.

You'll select Options/SET Command... and then select COLMARK from the options list. You check off "Display Column Markers" and then enter a column number or a list of blank-delimited column numbers to place the markers in. For this example you'll specify just column 50 so the SET command dialog box looks like this:

Since this is something you probably want to set only during this particular editing session you will click the "OK" button and not the "Save Setting" button. The image below shows the results:

Column 50 is just to the right of the thin vertical gray line so entering "yes" in this column becomes easy as the results show:

Suppose you have a file like the one below that has one record per line of the file and the fields of each record line up in certain columns:

The fields, of course, are last name, first name, middle initial and street. You could set a colmark to each of these fields but for this situation the SET BOUNDMARK command would be even better. SET BOUNDMARK works very much like SET COLMARK except that with SET BOUNDMARK you can indicate that you want the vertical column markers to coincide with your tab settings, left and right margins, zone settings, etc. Since you have distinct fields in each record it would be handy to be able to tab among them so you can set tab columns to coincide with the field columns. You can then set boundmarks to the tab columns to provide good visual feedback as to where each data field starts.

If you open the Options/SET Command... dialog and select TABS from the options list you see this:

You un-check the option labeled "After Any Specific Columns, Set Tabs Every". You un-check this because you want the cursor to wrap when you try to tab beyond the last field of one line to the first field of the next line. You'll check the item labeled "Set Specific Tab Columns" and then, for this example, you'll list the tab columns of 1, 13, 30 and 39. So the SET dialog now looks like this:

Next you select BOUNDMARK from the options list and you see this:

By default KEDIT uses boundmark markers for the zone columns and the truncation column so these items are already checked off. You'll check the "Tab Columns" item and then click "OK" to dismiss the dialog. The vertical lines appear in the file window:

KEDIT Home Page
KEDIT Overview | Download Libraries | Maintenance Releases
Ordering/Licensing | Demo Version | Technical Support | What's New
KEDIT for Windows 1.6.1 Upgrade | KEDIT Mailing List

Copyright © 1996-2012 Mansfield Software Group, Inc.