string has the below values as example cannot use find as the characters keep changing but the format remain same
First
//file:/abc/xyz/zyx/hcdff/ nsledf/abcde
//file:/abc/xyz/zyx/hcdff/ nsledf/abcde/
I need to extract in both the scenario abcde value
Solved! Go to Solution.
hi @abhijeet_86
Please find the below expected solution.
Input:
Output:
If this helps, please like this post and mark it as a solution. If you have any other questions, please let us know.
Many thanks
Shanker V
Hi @abhijeet_86
Step 1; Input tool
step 2: Formula tool
if (Right([Field1],1)="/")
then Left([Field1],length([Field1])-1)
else [Field1]
endif
Step 3: Regex tool
(\w*)$
If this helps, please like this post and mark it as a solution. If you have any other questions, please let us know.
Many thanks
Shanker V
thing is that it is string has a value
file://abc.dfg.com/byx/kht/rtioop-reports-fhgjhjh/fkdkjsfks/Region Product Trading Report - Daily
while applying your formula value i am getting is Daily whereas the expected value is
Region Product Trading Report - Daily
Hi @KrishnaChithrathil it is good however it gives me issue
when last character of string is /abcde fgh/
it only capture abcde, here i need abcde fgh
it does work for /abcde_fgh/
it give value as abcde_fgh
@abhijeet_86 , You will have to use regex for this. This is how it will work. Please accept my solution it if was useful to you.
Hi @abhijeet_86, you should be able to tackle this without any RegEx or more complex formulae:
TrimRight() will remove any trailing '/' which would otherwise throw off the FileGetFileName() function.
The FileGetFileName() function is designed to return file names from paths which it looks like is the case here?