How To: Change the order of field names in an attribute table
The instructions provided describe the process for changing the order of field names in an attribute table.
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.
- In ArcCatalog (or the Catalog window in ArcMap), right-click the feature class > Export > XML Workspace Document.
- Select 'Schema Only' for the 'What do you want to export' option, and specify the output location.
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.
- Open the output file with any XML editor.
- Navigate to the FieldArray section (esri:Workspace > WorkspaceDefinition > DatasetDefinitions > DataElement > Fields > FieldArray). Within the FieldArray section are listed the fields from the attribute table.
- 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.
System managed fields (such as OBJECTID or any shape fields) must never be moved.
- 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.
Any characters out of place may corrupt the document.
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.
- When done editing, save and close the XML document.
- In ArcCatalog (or the Catalog window), right-click the target file geodatabase. Select Import > XML Workspace Document.
- Select to import the schema. Specify the newly edited XML document. Click OK > Finish.