Hi Team
I have a varying folder structure \\Folder\Test\Test1\Test2\.......\2021\06. Jun\09\Test.xlsx
I need to get it trimmed to last sec occurrence of '\' and get me output as
\\Folder\Test\Test1\Test2\.......\2021\06. Jun
I can use reversestring, Findstring but its getting very lengthy .Any quicker way of doing this
Solved! Go to Solution.
Hi @NidhiAg
I want to caveat that I'm not a regex expert, but the below looks to work in regex parse mode.
(.*)\\.*\\.*
Didnt work with my actual path. Can you please explain me the Regex.
Update : my Path can vary and all i want to get path excluding FileName and last folder
Hi @NidhiAg
You might need to increase the size of the field in the regex tool. I just tried with a few different paths and it seems to work, but some longer paths were truncated until I increased the size.
(.*)\\.*\\.*
(.*): All characters
\\.*: All characters after a \
The parenthesis indicates what we're outputting. In this case all characters before it sees two slashes (and anything after those 2 slashes).