Hi all,
I'm transitioning from ArcMap to ArcGIS Pro - no experience of Python but would like to learn.
I'm trying to run a very simple string function to remove four digits at the end of text field. In ArcMap VB Script I would do the following:
Left([FieldName],Len([FieldName])-4)
I can't see how to do the same in Python.
There seem to be relatively few examples here:
Calculate Field examples—Help | ArcGIS Desktop
and the link to the build in functions of Python returns a 404 error.
Is there a good resource that sets out the functions and arguments for Python in ArcGIS? I have googled but can't find what I'm looking for!
Thanks in advance for any help,
Helen
Solved! Go to Solution.
perhaps
a = '1234567890'
a[:-4]
'123456'
# ---- if 'a' were the field name, you would use !a![:-4] in the field calculator
perhaps
a = '1234567890'
a[:-4]
'123456'
# ---- if 'a' were the field name, you would use !a![:-4] in the field calculator
I find the python docs succinct and complete
3. An Informal Introduction to Python — Python 3.7.4 documentation
Perfect, I will take a look, very many thanks.
Thanks Dan,
That worked perfectly - any suggestions on good resources for learning?
Thanks,
Helen