Skip to main content

File Functions

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

FileAddPaths

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

Example

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

FileExists

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

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

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

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".