Contents
Display Legacy Contents

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


     
Example 1
  Example 2
FileExtractPart("C:\MIS\Kalipso\Testfile.txt", PARENT_FOLDER)

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

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

Result = txt
  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.
See also
Samples
 
Updated: 3/28/2018 11:16 AM