1

I have data in a column that looks like the below example:

El Monte CA

I need to move the last 2 characters to a separate column. Which function in the field calculator will deliver those results?

  • 1
    I could guess that you are using ArcGIS since you tagged vbscript, but it would be helpful if you can confirm what software you are using. Also, if you are using ArcGIS, are you willing/able to use Python? – Evil Genius Jul 24 '15 at 17:00
5

Use the Right Function

Right( [textField], n )
(where n is the number of characters)

eg: Right(“abcdefg”, 3) = “efg”

This is pretty handy for learning how to use the field calculator http://www.esri.com/news/arcuser/0405/files/fieldcalc_1.pdf

  • You're welcome. Thanks please mark this answer as correct too, so it will help others. – cl3 Jul 24 '15 at 16:43
  • Another option you may see is [textfield].split()[-1:]. Not better or worse, just different.@cl3 's answer is better than split() for a string with no spaces. – recurvata Jul 24 '15 at 16:57
  • !textfield![-2:] using Python – FelixIP Jul 25 '15 at 4:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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