craiguwl

Python Script for Field Calculator

Discussion created by craiguwl on Apr 11, 2011
Latest reply on Apr 11, 2011 by lpugh01
Hi,

I'm looking for a Python script which parses a street prefix from a combined road name.  I used the following VBScript in ArcGIS 9.3 but am having issues converting this to Python.

Dim dir as String
If [STREET] like "[NESW] *" THEN
dir = LEFT ([STREET],1)
ElseIf [STREET] like "[NESW][NESW] *" THEN
dir = LEFT ([STREET],2)
Else
dir = ""
End If
__esri_field_calculator_splitter__
dir

Outcomes