A powerful Data transformation language similar to Pascal is included in all our ETL and Business automation tools.

It can be used with Calculation Transformation FunctionPackage Script Action or inside any text object


FileAge(FileName)

Call FileAge to obtain the OS timestamp of the file specified by FileName. The return value can be converted to a TDateTime object using the FileDateToDateTime function. The return value is -1 if the file does not exist.

FileExists(FileName)

FileExists returns true if the file specified by FileName exists. If the file does not exist, FileExists returns false.

DeleteFile(FileName)

DeleteFile deletes the file named by FileName from the disk. If the file cannot be deleted or does not exist, the function returns false.

RenameFile(OldFile,NewFile)

RenameFile attempts to change the name of the file specified by OldFile to NewFile. If the operation succeeds, RenameFile returns true. If RenameFile cannot rename the file (for example, if the application does not have permission to modify the file), it returns false.

ChangeFileExt(FileName,EXT)

ChangeFileExt takes the file name passed in FileName and changes the extension of the file name to the extension passed in Extension. Extension specifies the new extension, including the initial dot character.

ChangeFileExt does not rename the actual file, it just creates a new file name string.

ExtractFilePath(FileName)

The resulting string is the leftmost characters of FileName, up to and including the colon or backslash that separates the path information from the name and extension. The resulting string is empty if FileName contains no drive and directory parts.

ExtractFileDir(FileName)

Extracts Directory part from the File Name provided

ExtractFileDrive(FileName)

ExtractFileDrive returns a string containing the drive portion of a fully qualified path name for the file passed in the FileName. For file names with drive letters, the result is in the form "drive". For file names with a UNC path the result is in the form "\servername\sharename". If the given path contains neither style of path prefix, the result is an empty string.

ExtractFileName(FileName)

The resulting string is the rightmost characters of FileName, starting with the first character after the colon or backslash that separates the path information from the name and extension. The resulting string is equal to FileName if FileName contains no drive and directory parts.

ExtractFileExt(FileName)

Use ExtractFileExt to obtain the extension from a file name.

ExpandFileName(FileName)

ExpandFileName converts the relative file name into a fully qualified path name. ExpandFileName does not verify that the resulting fully qualified path name refers to an existing file, or even that the resulting path exists.

ExpandUNCFileName(FileName)

ExpandUNCFileName returns the fully-qualified file name for a specified file name.

ExtractRelativePath(FileName)

Call ExtractRelativePath to convert a fully qualified path name into a relative path name. The DestName parameter specifies file name (including path) to be converted. BaseName is the fully qualified name of the base directory to which the returned path name should be relative. BaseName may or may not include a file name, but it must include the final path delimiter.

DiskFree(Drive)

DiskFree returns the number of free bytes on the specified drive, where 0 = Current, 1 = A, 2 = B, and so on.

DiskSize(Drive)

DiskSize returns the size in bytes of the specified drive, where 0 = Current, 1 = A, 2 = B, etc. DiskSize returns -1 if the drive number is invalid.

GetCurrentDir(Directory)

GetCurrentDir returns the fully qualified name of the current directory.

SetCurrentDir(Directory)

The SetCurrentDir function sets the current directory. The return value is true if the current directory was successfully changed, or false if an error occurred.

CreateDir(Directory)

CreateDir creates a new directory. The return value is true if a new directory was successfully created, or false if an error occurred.

RemoveDir(Directory)

Call RemoveDir to remove the directory specified by the Dir parameter. The return value is true if a new directory was successfully deleted, false if an error occurred. The directory must be empty before it can be successfully deleted.

FileMD5(FileName)

Call FileMD5 to get MD5 checksum for a file.

Next: Date and time functions