Beginner's problems with iterating through an attribute table and exporting points

1481
2
11-16-2011 02:38 PM
SamCoggins1
New Contributor III
I'm reasonably new to Python, with no programming experience (I'm told I don't need any!). Having problems thinking this one through and would like some help if anyone can offer.

I have a shapefile with a 47 point features in it.
I would like to iterate through and extract each feature to a single point.
Obviously I can do this using the export data function in ArcDesktop, but I'd like to start automating more frequently.
So, I know I can do this in Python, probably with the Select tool from ArcToolbox, and by iterating through the FID field in the attribute table to output each point. However, I have no idea how to get started on this, beyond 'import arcpy'.

Can anyone offer suggestions? Thanks.
Tags (2)
0 Kudos
2 Replies
StephanieWendel
Esri Contributor
You'll probably want to start out with a Search Cursor and for loop to go through each of your features. Check out this link: http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#/SearchCursor/000v00000039000000/

Next, in the for look you would want to do a Select by Attributes on the FID of the value that it is currently hitting in the list. http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//001700000071000000

After you have selected the feature by its FID, use the feature class to feature class tool to export it. http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//001200000020000000

I hope this helps!
0 Kudos
DanPatterson_Retired
MVP Emeritus
For version 10 or Arcmap use Split Layer by Attributes
http://resources.arcgis.com/gallery/file/geoprocessing/details?entryID=37AEB018-1422-2418-A036-CA6D9...
querying on the FID field will allow you to produce separate shapefiles for each point in your source shapefile.
0 Kudos