ExtractFileName
Syntax
%ExtractFileName(Str)%
Description
Extracts the name and extension portions of a file name. The resulting string is the right-most characters of the file name, starting with the first character after the colon or backslash that separates the path information from the name of the file and its extension. The resulting string is equal to FileName if FileName contains no drive and folder parts.
For instance, if the complete path and file name specified was:
c:\automation\my_groovy_tasks\my_number_one_task.aml
This extended function would return:
my_number_one_task.aml
Parameters
Parameter | Description |
---|---|
Str | A text string containing the full path from which the file name should be extracted. |
Example
Sub
Main
'will return filename.txt
MsgBox ExtractFileName("c:\foldername\filename.txt")
EndSub
See also