File Functions

Version:
2019.3
Last modified: October 29, 2019

A file function builds file paths, checks to see if a file exists, or extracts a part of a file path. File functions can only be used with String data types.

FileAddPaths(Path1, Path2): Adds two file path parts, making sure there is exactly one \ (backslash) between the two paths.

Example

FileAddPaths([C:\Temp], [Data\file.csv]) returns "C:\Temp\Data\file.csv."

FileExists(Path): Returns True if the file exists and False if it doesn't.

Example

FileExists(C:\Temp) returns "True"

FileExists(C:\Temp\Data\file.csv) returns "True"

FileExists(C:\Temp\Data\NoFile.csv) returns "False"

FileGetDir(Path): Returns the directory portion of the path.

Example

FileGetDir(C:\Temp\Data\file.csv) returns C:\Temp\Data

FileGetDir(C:\Temp\Data) returns C:\Temp

FileGetExt(Path): Returns the extension of the path, including the . (period).

Example

FileGetExt(C:\Temp\Data\file.csv) returns ".csv"

FileGetExt(C:\Temp\Data) returns " "

FileGetFileName(Path): Returns the name portion of the path, without the extension.

Example

FileGetName(C:\Temp\Data\file.csv) returns "file"

FileGetName(C:\Temp\Data) returns "Data"

Was This Helpful?

Need something else? Visit the Alteryx Community or contact support.