I have two shapefiles, Country and Blocks. I need to run a very basic selection to find out what blocks intersect the country shapes. But, the country shapefile has 250+ countries and I need to do this for each row. The output is a list (ideally a .txt file) of one of the attributes of the block shapefile. I'm trying to automate this so I don't have to query each country then run the intersection manually. I'd like to run a Python script or make a model builder, but I don't know how to automate going from one row to the next.
Why not do an intersect or identity and then use either frequency or summary statistics to sort the results?
Intersect / Identity will join the tables so values from both shapefiles will be accessible and then Frequency / Summary Statistics to reduce the results into just the unique combinations of countries and blocks. Output is a table which can be exported to CSV.
I have also done similar using a search cursor and then get the object id's, make a layer using a query (ObjectID = value) to isolate just the single block and then select layer by location, get count... just remember to delete the layer each time you've finished with it.
Either method will produce a result it just depends on what you want to do with the block/country combination and if you have access to INFO/Advanced level of license.