How To: Use the Field Calculator to add a prefix and a space to a field
A field value may be added that includes a prefix followed by a space. For example, a state prefix and a space can be added to a city field in the attribute table. The image below shows the City field being added with a prefix value of TX and a space.
With the Field Calculator, add a field with a user-defined prefix or use an existing field from the attribute table.Adding a user-defined prefix
- In ArcMap, start an edit session. For more information on starting an edit session, refer to ArcGIS Help: Starting an edit session (Start Editing).
- Right-click the feature with the attribute table to be added with a prefix. Click Open Attribute Table.
- Right-click the field where the prefix is added. Click Field Calculator.
- In the Field Calculator, enter the following expression in the text field at the bottom of the dialog window, depending on the parser language:
"<The prefix>" + " "+ "<the field>"
"<The prefix>" + " "+ !<the field>!
- Click OK. The prefix is added to the field as defined by the expression.
If the attribute table has existing fields to be used as the prefix for another field, concatenate the prefix field and the field to be prefixed. For more information on how to concatenate fields, refer to How To: Use ArcMap to concatenate fields in a table.
- ArcGIS Help: Fundamentals of field calculations
- ArcGIS Help: Making simple field calculations
- ArcGIS Help: Calculate Field examples
- ArcGIS Help: Starting an edit session (Start Editing)
- How To: Use ArcMap to concatenate fields in a table