Iterate Files (Model Tools)
Summary
Iterates over files in a folder.
Usage
This tool is only available from ModelBuilder for use in models. The tool is not available from the Geoprocessing pane or from Python.
The File Type parameter allows you to iterate over files with a particular extension. For example, if you only want files with the
.logextension to be iterated, specify log as the FileType parameter value.If the file appears as a dataset in the Catalog pane, the tool will skip the file. The most common examples are shape files,
.dbffiles, raster files (.jpg,.tif,.img,.png, and.bmp), CAD files (.dxfand.dwg) and map files (.mxd,.aprx).The tool has two outputs: File and Name that can be used as an inline variable (for example,
%Name%) in other tools.Specify the file extension in the optional parameter for extensions such as
.txt,.pdf,.zip, and so on. For example, if the tool iterates over text files and the output is used in tools such as the ASCII To Raster tool, specify txt.Most tools honor the output file format from the this tool except tools such as Copy, which requires you to define the file extension in the output name. For example, If you are using the this tool to iterate
.zipfiles for use as input to the Copy tool, the output name must contain the extensionName.zipor%Name%.zip.
Parameters
| Label | Explanation | Data type |
|---|---|---|
|
Folder |
The folder where the input files are located. |
Folder |
|
Wildcard (Optional) |
A combination of |
String |
|
File Type (Optional) |
The file extension, such as txt, zip, and so on. Only files with the extension will be iterated. Do not use a period before the file extension. |
String |
|
Recursive (Optional) |
Specifies whether all subfolders of the main folder will be recursively iterated.
|
Boolean |
Derived output
| Label | Explanation | Data type |
|---|---|---|
|
File |
The full path to the file. |
File |
|
Name |
The name of the dataset. |
String |
Environments
This tool does not use any geoprocessing environments.
Licensing information
- Basic: Yes
- Standard: Yes
- Advanced: Yes