Quantcast
Channel: Forums - Python
Viewing all articles
Browse latest Browse all 2485

Dissolve - python looping

$
0
0
Hi All,

I started learning python coding recently. I have hundreds of shape files in a geodatabase. i am dissolving certain fields in each shapefile. For this i am writing a for loop so that it reads each shape file in the geodatabse, dissolves the identical fields and save them in a new geodatabase as a separate file. Can anyone help me to write the code so that each file is saved with different name. Here is the code i came up with.

# import system modules
import arcpy
from arcpy import env
import os

# Set environment settings
env.workspace = "C:/Users/raghuravi23/Desktop/New folder/test2.gdb"

# Set local variables
fcList = arcpy.ListFeatureClasses()

for fc in fcList:
arcpy.Dissolve_management(fc, "C:/Users/raghuravi23/Desktop/New folder/Blocks.gdb", ["STATEFP10", "COUNTYFP10", "TRACTCE10", "BLKGRPCE10", "BLOCKCE10"],"[[Shape_Length,{sum},Shape_Area,{SUM}]]", "", "DISSOLVE_LINES")

Thank you very much

Viewing all articles
Browse latest Browse all 2485

Latest Images

Trending Articles



Latest Images