Function: FileNameSplit
- Updated2024-09-12
- 1 minute(s) read
Function: FileNameSplit
Function: FileNameSplit
Valid names: NameSplit
Extracts information from a text.
ReturnValue = NameSplit(String, Type)
Input Parameters
| String | Specifies a text or a text variable that contains a filename with extension and path. | |||||||
| Type | Specifies the wildcard for the file information you want to extract: | |||||||
|
Return Parameters
| ReturnValue | Returns the filename, the path, or the extension as text. The function returns an empty text if the specified text does not contain the information you want. |
Examples
The following examples extract various information from a file.
| VBScript | Python |
Dim strMyResult strMyResult = NameSplit("C:\Folder\Test.txt","P") 'strMyResult = C:\Folder\ strMyResult = NameSplit("C:\Folder\Test.txt","N") 'strMyResult = Test strMyResult = NameSplit("C:\Folder\Test.txt","E") 'strMyResult = txt strMyResult = NameSplit("C:\Folder\Test","E") 'strMyResult = ""
Related Functions
Command: TTD | Function: Char | Function: FCNo | Function: Idx | Function: Len | Function: PU | Function: Str | Function: Textaddition (+) | Function: TTR (Text to Real) | Function: Val