Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I need scripts for the field calculator that:

  1. extracts the first word from a column, i.e. "Jones School" - "Jones", and
  2. A script that will capitalize this new field, "Jones" - "JONES".

This is Arc 10.

share|improve this question

Assuming you consider a space as a separator:


!myField!.split(" ")[0].title() # Proper Case
!myField!.split(" ")[0].upper() # Upper Case


UCase(Left([myField],1)) & LCase(Mid([myField],2,InStr([myField]," ")-1)) ' Proper Case
UCase(Mid([myField],1,InStr([myField]," ")-1)) ' Upper Case
share|improve this answer

The Python string manipulation methods should give you access to all of the features you are looking for:

To extract words from a string, take a look at the usage of:

str.split([sep[, maxsplit]])

For capitalizing your word(s), take a look at the usage of:

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.