Extract File Name from File path
I have a script that works like this:
The user is prompted to select a file from the drive directory
Of course the path may have more or fewer 'segments'(ie, folders. If I know how long the path is and if I know
where the last '/' is, I should be able to pull out the file name; right?).
Question: "What is the best way to isolate the filename from the path?"
Got this off BrianDunning.com
Right ($FilePath ; Length ( $FilePath ) - Position ( $FilePath ; "/" ; 1 ; PatternCount ( $FilePath ; "/" ) ) )
Works great! I need to remember to check BD!