Removing Characters from table

4361
4
Jump to solution
07-17-2014 01:00 PM
WilliamRice1
New Contributor


I am trying to use the field calculator to remove text in a data table. All of the addresses have (6) zero's in front of the address and I am trying to remove them. I am using arcmap 10.1 with a standard license.

 

Can someone tell me how to remove the first 6 characters in each entry.

0 Kudos
1 Solution

Accepted Solutions
DanPatterson_Retired
MVP Emeritus

actually

>>> a = '00000012345'

>>> a[6:]

'12345'

>>>

View solution in original post

0 Kudos
4 Replies
BrandonColeman
New Contributor III

Using the field calculator, you should just make a new string without the 6 zeros.

Try something like...

!FieldName!.replace("000000", "")  -- if 6 zeros only exists once in each record

!FieldName![5:] ‌--this should pull all characters past the 6th character to the end

Check these for more help

ArcGIS 10 Python split string - Geographic Information Systems Stack Exchange

ArcGIS Desktop --this may be better

0 Kudos
DanPatterson_Retired
MVP Emeritus

actually

>>> a = '00000012345'

>>> a[6:]

'12345'

>>>

0 Kudos
BrandonColeman
New Contributor III

Thanks for the correction.  At least I had the idea right.

0 Kudos
StevenGraf1
Occasional Contributor III

Find and replace would be easier.  You don't need any code.

0 Kudos