Rename Fields - Rename fields directly in multiple dBASE or INFO files
With this function you can rename multiple fields in multiple tables or themes. In addition to the original field name this dialog contains a column with the new name (if it is unchanged, this column stays empty). You can rename each field individually (just double click on it) or modify several field names using a calculation expression. This function works extremely fast, because the fields are renamed directly in the dBASE and INFO files on the hard disc (in other extensions new fields are created and all field values are copied).
pressed to select multiple tables or themes).
Common Fields: Shows the fields that occur several times (fields with the same name in the same or in different tables). Click on a field to select or drop the corresponding fields in Unique Fields. Double click on a field to rename all corresponding fields in all tables (a small dialog window appears).
Unique Fields: Shows either the unique fields (option is active) or all fields (option is inactive). Select the fields you want to rename. See detailed information at Hints to select fields. Double click on a field if you want to rename it (a small dialog window appears).
Name: To rename the selected fields you can enter any valid Avenue function for strings (see ArcView online help), that uses an "N" as a variable for the original name. Further you can use the variable "A" for the alias of the field name in the spreadsheet, "T" for the base name of the table and "C" for a consecutive count (starting at 1).
- You must activate the tables or themes, in which you want to rename fields, before calling the function (click on them with the mouse pointer - keep the
The simplest function is adding characters at the beginning (e.g. "old_"+N) or at the end of the name (e.g.
N+"_new"). The maximum length of field names is 10 characters in dBASE and 16 characters in INFO tables. Longer field names will be truncated in the table file and the full name will only be used as an internal alias in the project.
To avoid this, you can keep e.g. the first 6 characters of the old name ("old"+N.Left(6) or
You can also keep parts from the middle of the name (e.g. "A"+N.Middle(1,4)
to get the characters 2 to 5 and replace the first character by an
Further you can replace specific characters by others (e.g. N.Substitute("_", "-") to replace an underscore by a hyphen,
N.Substitute("old", "new") to replace "old" by "new" or
N.Substitute("-", "") to remove all hyphens.
To get fields numbered consecutively you can use the counter, e.g. "ID"+C.AsString to name the fields
ID3 etc. or
"ID"+(C-1).SetFormat("dd").AsString to name the fields with two-digits starting at 0 (ID00,
ID01, ID02 etc.).
If you want to rename fields in several tables and integrate the name of the table (i.e. the name of the dBASE or INFO file) in the field name, use the variable "T", e.g.
T.Left(4)+"_id" to name the fields in the tables "europa.dbf" and "america.dbf"
In some cases it is necessary to use the alias of the field name, e.g. if you have renamed the fields previously and found out that the resulting field names became too long (in the spreadsheet the field will be displayed with the full alias, but when using the functions of
Arc4You Data you see the real shortened field names). All above mentioned functions can also be used with "A" instead of "N", e.g.
A.Substitute("old", "A"). You can also rename fields that became to long in a calculation process (e.g. with the function
Sum Attributes) using the alias.
- If you want to give all selected fields the same name, put it in quotation marks (e.g.
Apply: Click on this button to rename the selected fields using the avenue function Name. You can repeat this process several times with several functions.
Click on to apply the changes to the table fields. Now either the dBASE file or the corresponding INFO file will be opened with direct write access (the definition file arcXXXX.nit for each table can be found in the INFO directory using the file arc.dir). If this isn't possible (e.g. because another user or program has access to the file) the function will be stopped with an error message. Otherwise the new field name will be changed directly in the file. If you rename a field, that is currently used in a theme legend as a classification field, this legend will be adjusted too (all Views and Layouts of the active project are checked).
If you gave several fields of the same table the same name by mistake, an error message is displayed. If you confirm it with
you will create duplicate field names, which could cause problems and errors. To be on the save side, stop the process with
and rename one of the identical fields.
The status bar finally shows the number of renamed fields and the number of legend fields, that had to be renamed too.
© 2003 WLM Klosterhuber & Partner OEG