AnsweredAssumed Answered

Issue creating Python script to batch convert .e00 files to shapefiles (.shp) with ArcGis 10.4.1

Question asked by pstevens9 on Mar 8, 2018
Latest reply on Mar 12, 2018 by pstevens9

Hi there. 


I'm not only new to Python, but also to ArcGis and I'm quite stuck trying to create a script to batch convert .e00 files to .shp files.


I've started working with a script that I found in this very own site, but I'm not able to make it work properly. It seems that the first part of the code, where the conversion to coverage files is made, runs fine, but the second part, where the conversion to .shp files should be made, doesn't work. It just does anything.


I don't get any traceback erros. Could you please give me a hint? 



import arcpy, os 
arcpy.env.overwriteOutput = True

arcpy.env.workspace = ws = r'C:\in'
out = r'C:\out'

if not os.path.exists(out):

for cov in arcpy.ListFiles('.e00'):
arcpy.ImportFromE00_conversion(cov, ws, cov.split('.')[0])
print 'Converted %s' %cov 

for cov in arcpy.ListFiles():
if not '.e00' in cov and cov != 'info':
  arcpy.env.workspace = os.path.join(ws,cov)
  for fc in arcpy.ListFeatureClasses('*polygon'):
   shp = os.path.join(out, '%s.shp' %cov)
   arcpy.FeatureClassToFeatureClass_conversion(fc, out)
   print 'Converted Coverage to %s' %shp


Thank you so much in advance.