1

I'd like to write an ArcPy script to import a large number of shapefiles into an EXISTING feature class. I also need to be able to perform column mappings as there may be different column names. I need to write a script so I can automate this process.

I'm not looking for a complete script but rather advice as to where I should be looking to perform this task. I'm fairly new to ArcGIS.

2
  • Perform your workflow from the tool dialogs first and use the Geoprocessing | Results window to Copy As Python Snippet to write most of your code, then add some iteration. You'll find column mapping referred to as field mapping in the documentation.
    – PolyGeo
    Commented Jan 29, 2015 at 21:34
  • There may be another tool I should be using but so far, I used Conversion -> To Geodatabase -> Feature Class to Feature Class. Unfortunately, it doesn't want to use an EXISTING feature class for the destination. Is there a similar tool that does allow targeting existing FCs? Commented Jan 30, 2015 at 17:17

1 Answer 1

1

My favorite shortcut for this is to run the Append tool once using the standard toolbox tool and set up my field mappings using the graphic interface.

Then when the tool is done running, open the results window, right click on the information about the operation you just ran and click "Copy as Python Snippet".

Then you can paste the code into your script, manipulate it to work with whatever you are doing specifically - but - you don't have to type in the field mappings manually, you benefit from the more intuitive graphic interface provided in the one-off tool.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.