Writing file names automatically when using batch tools

7482
9
10-09-2011 11:46 PM
KilianOtto
New Contributor
Hi @ all,
is there a way to use any kind of batch tool and give the output a new name whitout doing this manually?
E.g. I would like to clip 100 features. Then would like to write the new files in a directory with the original name + "clip".
Kind Regards
9 Replies
SimonKettle
Regular Contributor
I use "bulk rename utility" for doing this exact operation... http://www.bulkrenameutility.co.uk/Main_Intro.php all you do it open up the programme and go to the folder in question within Microsoft Explorer and select your files and edit appropriately.

Easy peasy...

Cheers,
0 Kudos
KilianOtto
New Contributor
Hi,
thank you for the response, but i guess you missunderstood my question.
You use tools in arcmap in batch mode.
But if you create new files, e.g. if you clip multiple features, you have to type in a name for every single new feature class. My question was, if it is possible to do that automatically.
Kind regards
0 Kudos
SimonKettle
Regular Contributor
Yes sorry...I misunderstood your question. Do you mean using an ArcTool to clip several shapefiles and have them automatically rename with a _clip suffix?

Are you using Arc10? Because when I batch clip a bunch of shapefiles it automatically renamed all the shapefiles as "..._clip" and puts them into the default geodatabase (which is quite tidy)

My method is open ModelBuilder from ArcMap >Insert a variable (shapefile)>RC>properties>list of values then add the Clip (Analysis) tool [then add what your clipping to etc...]. This then produces feature classes in the default geodatabase with the suffix "_clip".

N.B you can drag shapefiles that are open in the TOC in ArcMAP into the variable.

If you are using 9.3.1 or an older version of ArcGIS you could use the same process but change the output folder to a folder of your choice (i.e. create a folder in ArcCatalog before starting the process). The using bulk rename utility edit all the files to include a suffix.

I hope that helps.
0 Kudos
HenrikSvenningsen
Occasional Contributor
maybe you could use something like:

%Name%_clip

in the end of your output format
SebastianSantibanez
New Contributor
A simpler method would be using "Iterate Feature Class" and use the Name as an in-line variable (as GEOSTUV03 suggest).
0 Kudos
EricaNewton
New Contributor
I have gotten to the point where I am using an iterator to rename the end products in my model (eg. clip_%name%), but if I batch run the model, only the first item in the batch list is named properly, and everything else ends up named "raster##" and dumped into a default folder.  Any ideas??
0 Kudos
SebastianSantibanez
New Contributor
I had problems combining batch and iterators too.  The fellows from ESRI advised me to avoid combining these two tools (although there was no further explanation on why...).  I ended up not using batch at all and nesting different models when I required more than one iterator (you can just put 1 iterator per model). 

I hope it helps
0 Kudos
ShitijMehta
Esri Regular Contributor
This is forum thread which sebastian_4m is talking about. It shows how to nest all the models. Look at the image attached with the thread on 09-26-2011 02:07 PM.

Nested Model
0 Kudos
EricaNewton
New Contributor
Thanks for the speedy reply.  I'll give that a try.

Erica
0 Kudos