Parse Path - < file_path_parse >() ... [Pro]
File Parse Path <file_path_parse>("File path",Variable for Drive or Server,Variable for Folder,Variable for Name,Variable for Extension) Available in: Professional edition
|
This command parses (full qualified) file path to these parts: drive or network server, folder, file name, and file extension.
|
#
|
Parameter name
|
Parameter description
|
1
|
File path
|
File path to be parsed. For example: c:\my folder\sub1\sub2\results.doc
|
2
|
Variable for Drive or Server
|
Variable that receives drive or network server address part of the file path. For example: c
|
3
|
Variable for Folder
|
Variable that receives folder part of the file path. For example: my folder\sub1\sub2
|
4
|
Variable for Name
|
Variable that receives file name part of the file path. For example: results
|
5
|
Variable for Extension
|
Variable that receives extension part of the file path. For example: doc
|
|
|
Example (Macro Steps):
|
1
|
<#> <#>This macro breaks 'c:\program files\any program\application.exe' file path to parts
|
2
|
Macro execution: ONLY COMMANDS
|
3
|
File Parse Path File path = "c:\program files\any program\application.exe", Variable for Drive or Server = "vDrive", Variable for Folder = "vFolder", Variable for Name = "vName", Variable for Extension = "vExt"
|
4
|
Message SHOW "Information" : "Drive: %vDrive% Folder: %vFolder% File: %vName% Extension: %vExt%" (other parameters: x = -100, y = -100, Window title = , Buttons = OK, Timeout (seconds) = 0, Always on top = No).
|
|
Example (Plain Text):
<#>This macro breaks 'c:\program files\any program\application.exe' file path to parts
<cmds>
<file_path_parse>("c:\program files\any program\application.exe",vDrive,vFolder,vName,vExt)
<msg>(-100,-100,"Drive: %vDrive%
Folder: %vFolder%
File: %vName%
Extension: %vExt%","",1,0,0,0)