1

Is there a option / way in ModelBuilder to move the files I am processing in a Folder to a specific other folder (like the input folder - and done folder)?

I now Iterate files in a Folder, make a table of it, and append to a geodatabase in a server.

So I don't need to move them everytime myself when it's all done.

  • 1
    Do you mean you want to set an output workspace? – Vince Aug 25 '17 at 11:17
  • just move the processed files. So yes, sounds like a output workspace – Bjorn ten Broeke Aug 25 '17 at 12:47
1

You can create a script tool to insert into your model.

Here are the instructions for creating a script tool.

In the tool you will need 2 parameters:

  • Source File - Direction is 'Input', Type is 'File'
  • Output Folder - Direction is 'Input', Type is 'Folder'

Then save this code as a python file (.py):

import shutil

source = arcpy.GetParameterAsText(0)
output = arcpy.GetParameterAsText(1)

shutil.move(source, output)

You'll need to add this file as the source code for the script tool.

Then add this into your model. You'll need to set the output of the 'Table to Table' tool (or whatever tool you are using to process the files) as a precondition for the 'Move Processed' script tool (In the image this is the dotted line going from test.dbf to Move Processed):

enter image description here

This will move each file to your 'processed' folder after it has run through your model.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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