Changing the case of text field values

This task will convert the following three strings: example text, EXAMPLE TEXT, or eXAMPLE tEXT to Example Text.

  1. Right-click the layer or table you want to edit and open its table.
  2. Add a new text field to store the new string values.

    If you are editing, stop the current edit session. Click Table Options and click Add Field. Name the field, set the type to Text, then specify a length.

  3. Right-click the field heading for the field you just added and click Field Calculator.
  4. Choose Python as your scripting language.
  5. Paste the following code into the text box on the dialog box:
    ' '.join([i.capitalize() for i in !FieldName!.split(' ')]) 
  6. Click OK.

Related Topics