Directory Tool
Use Directory to return a list of all the files in the specified directory. The tool returns file names and other information about each file, such as its size, creation date, last modified date, and more.
One Tool Example
Directory has a One Tool Example. Visit Sample Workflows to learn how to access this and many other examples directly in Alteryx Designer.
Use Directory to return a list of all the files in the specified directory. The tool returns file names and other information about each file, such as its size, creation date, last modified date, and more.
Configure the Tool
Specify the Directory for which to return the file contents. Either enter in the location path or use the browse icon to navigate to the intended directory.
File Specification: Specify the type of files to return.
Wild card use examples:
*.*: Return all file types in the specified directory. The default value.
*.csv:: Return all CSV files in the specified directory.
temp*.*: Return all files that begin with temp in the file name:
temp1.txt and temp_file.yxdb
.
Include Subdirectories: Select to search for the specified file types in directories within the specified directory. When this box is unchecked, only files at the root level of the specified directory are returned.
View the Output
These fields are output from the Directory tool at runtime:
Name | Type | Definition |
---|---|---|
FullPath | V_WString | The entire path of the file. This includes the drive, directory, and file name. |
Directory | V_WString | Specified directory the file resides in. |
FileName | V_WString | The name of the file. |
ShortFileName | V_WString | Old filename convention used by versions of MS Windows prior to Win95 for compatibility with legacy programs. |
CreationTime | DateTime | Date and Time the file was originally created. |
LastAccessTime | DateTime | Date and Time the file was last read. This attribute is turned off by default on some operating systems. If you would like to know more about this attribute and enable it on your machine, please reference this article. |
LastWriteTime | DateTime | Date and Time the file was last written or updated. |
Size | Int64 | File size in bytes. |
AttributeArchive | Bool | The file or directory is an archive file or directory. Applications use this attribute to mark files for backup or removal. |
AttributeCompressed | Bool | The file or directory is compressed. This means that all of the data in the file is compressed. |
AttributeEncrypted | Bool | The file or directory is encrypted. This means that all data in the file is encrypted. |
AttributeHidden | Bool | The file or directory is hidden. It is not included in an ordinary directory listing. |
AttributeNormal | Bool | The file or directory does not have other attributes set. |
AttributeOffline | Bool | The file data is not available immediately. This attribute indicates that the file data is physically moved to offline storage. This attribute is used by Remote Storage, which is the hierarchical storage management software. |
AttributeReadOnly | Bool | The file or directory is read-only. For a file, applications can read the file, but cannot write to it or delete it. |
AttributeReparsePoint | Bool | The file has an associated reparse point. |
AttributeSparseFile | Bool | The file is a sparse file. |
AttributeSystem | Bool | The file or directory is part of the operating system, or the operating system uses the file or directory exclusively. |
AttributeTemporary | Bool | The file is being used for temporary storage. File systems attempt to keep all of the data in memory for quick access, rather than flushing it back to mass storage. |
Tip
You can drag and drop a folder from Windows File Explorer directly onto the canvas to create a Directory.