Cory Posted May 25, 2005 Report Share Posted May 25, 2005 Is there a simple way to get just the folder name without the entire path? E.g., from "\\server\share\dir1\dir2" get simply "dir2". I am currently setting string by browsing to folder and then deleting text but if the directory tree above changes this wont work. I'm thinking I must be missing something simple here. Quote Link to comment Share on other sites More sharing options...
kevin Posted May 25, 2005 Report Share Posted May 25, 2005 Try the Variable Set From File Path macro command. You can choose which part of filepath to place in specific variables. If the pathname is already in a variable, put that variable in the Filename/Path: field. Quote Link to comment Share on other sites More sharing options...
Cory Posted May 25, 2005 Author Report Share Posted May 25, 2005 I'm sorry, I must be dense. If I use "Variable set string from folder name" and browse to "\\server\share\dir1\dir2" and stick that in T1 then do the "Variable Set From File Path" and choose the path tick box on the right I get ""\\server\share\dir1\" but what I want is "dir2". What am I missing? Thanks! <TVAR2:01:10:><VFFILE:1:F:1:T:1:F:1:F:1:%T1%> Quote Link to comment Share on other sites More sharing options...
cyberchief Posted May 25, 2005 Report Share Posted May 25, 2005 In the example code that you attached... Try checking only "Filename" Under Varialble Set String %T1%. Quote Link to comment Share on other sites More sharing options...
Cory Posted May 25, 2005 Author Report Share Posted May 25, 2005 (said like Beavis) Yes Yes Yes!!!!! That rules!!! Thanks! I'm always missing the obvious. I just assumed since there was no file name that it wouldn't apply. Just in time too, I was just wrapping this up. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.