Rick Stanich
King and Supreme Ruler
- Local time
- Today, 14:12
- Joined
- May 13, 2009
- Messages
- 93
(SOLVED) How to get filename from string?
The code below is a snippet from this forum (Thank you).
I am trying to get the file name (remove path) from the variable "strInputFileName".
The path can vary, the drive will always be a network drive but could someday be renamed (you know how those IT types are. )
File path example:
Example:
4506667
C
235A
33557-1
235
090403
And to make it interesting, character length will never remain the same.
All hints, tips and or examples are appreciated.
The code below is a snippet from this forum (Thank you).
I am trying to get the file name (remove path) from the variable "strInputFileName".
strFilter = ahtAddFilterItem(strFilter, "Text Files (*.out)", "*.OUT")
strInputFileName = ahtCommonFileOpenSave( _
Filter:=strFilter, OpenFile:=True, _
DialogTitle:="Please select an Input file...", _
Flags:=ahtOFN_HIDEREADONLY)
Me!txtCustFilePath = strInputFileName
The path can vary, the drive will always be a network drive but could someday be renamed (you know how those IT types are. )
File path example:
The string "4506667 C 235A 33557-1 090403.OUT" is the file name. Right now the only portion of the entire path\filename that may remain the same is \\Mainnet\netdrive\CNC Mill\#19 CNC CMM\Inspection Reports\, the network drive, the file name will always have the same formatting. Spaces indicate an end of the string for the file name.\\Mainnet\netdrive\CNC Mill\#19 CNC CMM\Inspection Reports\SUNSTR\4506667\Raw data\33557-1\235\4506667 235A 33557-1 090403.OUT
Example:
4506667
C
235A
33557-1
235
090403
And to make it interesting, character length will never remain the same.
All hints, tips and or examples are appreciated.
Last edited: