Getting string data from a shape file attribute table

475
2
Jump to solution
06-02-2014 03:48 AM
fionasimpson
New Contributor
Hello

I am looking to extract string field from a shapefile attribute table to then allow me to do a number of IF logic calculations but I am not sure how to get that specific field from the shapefile to the allow me to script the calculations.

Any help or pointers would be very much appreciated.

Thanks
Fiona
Tags (2)
0 Kudos
1 Solution

Accepted Solutions
Zeke
by
Regular Contributor III
Some help here...
import arcpy  fc = 'yourfeatureclass' strfld = 'yourstringfield'  with arcpy.da.SearchCursor(fc, strFld) as cur:     for row in cur:         valueyouwant = row[0]         # do something with valueyouwant     

View solution in original post

2 Replies
Zeke
by
Regular Contributor III
Some help here...
import arcpy  fc = 'yourfeatureclass' strfld = 'yourstringfield'  with arcpy.da.SearchCursor(fc, strFld) as cur:     for row in cur:         valueyouwant = row[0]         # do something with valueyouwant     
fionasimpson
New Contributor
Thanks

That's great i have it working now.

Fiona
0 Kudos