On 10/25/06, Vince Teachout <[EMAIL PROTECTED]> wrote:
> Remove folders from example:
> \\server\share\folder1\folder2\folder3\folder4\filename.ext
>
> Or
>
> Remove folders from example:
> C:\folder1\folder2\folder3\folder4\filename.ext
>
> What I would like to return is just the individual folder names, never
> the drive letter, never the server, never the share name and never the
> filename itself...
Well, Justpath() gets you part of the way there.....
And Regular Expressions get you the rest of the way.
http://www.sweetpotatosoftware.com/SPSBlog/PermaLink,guid,9a28ad22-b41b-434a-a540-40e6197a099e.aspx
SET LIBRARY TO RegExp.dll
lcEscWhack = "\\"
lcWhackWhack = lcEscWhack + lcEscWhack
lcNotWhacks = "[^" + lcEscWhack + "]+"
lcAnythings = "(.+)"
lcOr = "|"
lcDrive = "[A-Z]\:"
lcFirstMatch = "\1"
lcSecondMatch = "\2"
lcServRegExp = ;
+ lcWhackWhack + lcNotWhacks ;
+ lcEscWhack + lcNotWhacks ;
+ lcEscWhack + lcAnythings ;
+ lcEscWhack + lcNotWhacks ;
+ lcOr ;
+ lcDrive + ;
+ lcEscWhack + lcAnythings ;
+ lcEscWhack + lcNotWhacks
lcServMatchPatt = lcFirstMatch ;
+ lcSecondMatch ;
+ lcEscWhack
lcFullPath = "\\server\share\folder1\folder2\folder3\folder4\filename.ext"
? regexp(lcFullPath, lcServRegExp, 1, lcServMatchPatt)
lcFullPath = "C:\folder1\folder2\folder3\folder4\filename.ext"
? regexp(lcFullPath, lcServRegExp, 1, lcServMatchPatt)
_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/profox
OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech
** All postings, unless explicitly stated otherwise, are the opinions of the
author, and do not constitute legal or medical advice. This statement is added
to the messages for those lawyers who are too stupid to see the obvious.