FileExtractPart

Kalipso - Form - Expressions - Functions - Functions Descriptions - String Functions - FileExtractPart

Extracts a part of the name of a file from a full file path.

Parameters

  • File Path <string expression> - The file path to extract the part from.

  • Part to Extract <string> - The part of File Path to extract. It can be one of:

    • PARENT_FOLDER – The parent folder of the specified file path.

    • FILE_NAME – The name of the file without extension.

    • FILE_EXTENSION – The file extension.

    • FILE_FULL_NAME – The file full name, including extension.

Examples

  • Example 1

FileExtractPart("C:\MIS\Kalipso\Testfile.txt", PARENT_FOLDER) Result = C:\MIS\Kalipso

  • Example 2

FileExtractPart("C:\MIS\Kalipso\Testfile.txt", FILE_NAME) Result = Testfile

  • Example 3

FileExtractPart("C:\MIS\Kalipso\Testfile.txt", FILE_EXTENSION) Result = txt

  • Example 4

FileExtractPart("C:\MIS\Kalipso\Testfile.txt", FILE_FULL_NAME) Result = Testfile.txt

This can also be used to extract the parent or the name of a directory if the path specified is for a directory and not a file.

Last updated