English

How To: Change the order of field names in an attribute table

Summary

The instructions provided describe the process for changing the order of field names in an attribute table.

Procedure

This workflow describes the process for exporting a feature class schema to an XML document. The XML document can be modified and used to create a new blank feature class.

  1. In ArcCatalog (or the Catalog window in ArcMap), right-click the feature class > Export > XML Workspace Document.
  2. Select 'Schema Only' for the 'What do you want to export' option, and specify the output location.

    Warning:
    The changes described must be limited to blank feature classes where the schema changes do not affect existing data. Changing the order of field names does not change the order of the data columns in the attribute table. Therefore, it is not recommended to export the data with the XML. Furthermore, if the data is exported with the XML, there is a significant potential for data corruption if the field data type is changed.

  3. Open the output file with any XML editor.
  4. Navigate to the FieldArray section (esri:Workspace > WorkspaceDefinition > DatasetDefinitions > DataElement > Fields > FieldArray). Within the FieldArray section are listed the fields from the attribute table.
  5. The method for reorganizing the fields depends on the XML editor used. If the XML editor organizes the XML into a tree format (like XML Notepad), the fields can be reorganized by moving each field folder.
    Select a field folder and drag it to the desired location in the field list.

    [O-Image]


    Warning:
    System managed fields (such as OBJECTID or any shape fields) must never be moved.

  6. If the XML editor organizes the XML as a script, the fields can be reorganized by copying the text between <Field and /Field> and reordering the text.
    Select the full text of the field, the cut and paste in the desired location.

    [O-Image]


    Warning:
    Any characters out of place may corrupt the document.


    Note:
    If the XML document is not formatted correctly, use one of any free online XML formatters. See the link below for an example of an online XML formatter.

  7. When done editing, save and close the XML document.
  8. In ArcCatalog (or the Catalog window), right-click the target file geodatabase. Select Import > XML Workspace Document.
  9. Select to import the schema. Specify the newly edited XML document. Click OK > Finish.

Related Information