1

I want to go through a folder and subfolders to copy some files in a gdb. At the moment I have tried to do it using the iterator file and the Copy tool. The problem is all the files have the same name, then I would need to rename and give them a only name before to copy them in the gdb.

I am not too sure how I could rename them automatically, any advice?

  • 1
    Advice - move to arcpy and abandon ModelBuilder. :) – Alex Tereshenkov Nov 8 '15 at 6:21
  • Thanks, but I don´t think I would be able to do it ;) . My knowledge in phyton is even worse than in Model Builder! – ASTURIES Nov 8 '15 at 10:06
  • It's easier to learn Python than ModelBuilder, you will manage it ;) – Alex Tereshenkov Nov 9 '15 at 6:56
1

Model builder has two built in system variables that you can use with in-line variable substitution to automatically rename files and give them unique names.

From the ESRI documentation on Examples of in-line variable substitution with ModelBuilder system variables:

Using the %i% system variable with in-line variable substitution enter image description here

Using the %n% system variable with in-line variable substitution

enter image description here

If you are using Iterate Feature Classes, you could combine the Name variable with the system variable in some tool's output parameter:

C:\path\to\your.gdb\%Name%_%n%

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.