Query a csv file with a search cursor to join certain entries to another shapefile

Discussion created by lad-water on Mar 7, 2012
Latest reply on Mar 8, 2012 by m.gasior
I am stuck and hoping someone here can help.  I am rather new to Python but came up with something I thought could help me and was attempting to implement it. 

I have a comma delimited file that contains a few columns of data, three of which I want to use.  I have rows of data categorized under one column called "SP" which has numbers from 1 to 10.  I want to be able to write a loop script that parses only the data for SP = 1, joins that data to another shapefile based on a column called Cell_ID, then for SP = 2 and joins that to a shapefile based on the column called Cell_ID, then SP = 3 and joins that to another shapefile based on a column called Cell_ID and so on.

I thought this task could be done using a search cursor with a where clause but I am not getting too far.  My guess is I am making it too hard because that is what I always do :9(

Could I get some hints as to if the search cursor would work (can you join to another shapefile based on the results of a search cursor?) and if so how would the where clause be implemented.  If that won't work can you point me in the right direction?