I'm trying to join nine feature classes to the nine tables that go with them and it all needs to be in a loop.
I've done this so far
soils = arcpy.ListFeatureClasses()
for soil in range(0,len(soils)):
I'm not sure if what I have done so far is correct and what to put in the parentheses so that all tables are joined to the right feature class.
The Join Field tool will actually join fields from one feature class to another. If this is what you want to do, you're on the right track.
You could actually use something like below:
soils = arcpy.ListFeatureClasses() for soil in soils: arcpy.JoinField_management(soil, "soilcode", "soiltype", "code", ["land_use","land_cover"])
The above will join the 'soiltype' table's fields 'land_use' and 'land_cover' to each feature class in the soils list using the 'soilcode' and 'code' fields.
A great way to start learning python is to run a tool in ArcMap. Click on Geoprocessing menu > Results. Right-click on the results > Copy as Python snippet. You can the paste the code in ArcMap's python window, or a python IDE of your choose, such as PyScripter.