DIAdem Help

Function: FileNameSplit

  • Updated2024-09-12
  • 1 minute(s) read

Function: FileNameSplit

Valid names: NameSplit

Extracts information from a text.

ReturnValue = NameSplit(String, Type)

Input Parameters

StringSpecifies 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:
Value Meaning
PPath
NFilename
EFilename extension

Return Parameters

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

VBScriptPython

 

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