Hi, such a silly question I know, but I want to remove the filename in a string such as
"blah\bleurgh\filename.txt"
To delete the extension I would do
strFile = Left(strFile, InStrRev(strFile, ".") - 1)
But doing similiar to delete the filename at the end does nothing, e.g.
tempStrFile = Left(tempStrFile, InStrRev(tempStrFile, "\") - 1)
A "\\" doesn't work either, incase it was an escape character issue.
Many thanks!
edit: for further information what I want to do is if given a filename such as "filename.txt" I want to output "output_filename.csv" - I have no problems with this.
If I get a directory though such as "blah\filename.txt" I have difficulty sticking output in the middle to get "blah\output_filename.csv"