• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Need help in getting the string between “\”

Madhuri_G

Member
Hello team

need help in getting the string after two slashes in the below path - I mean need get the keyword of ‘Microsoft SQL server’

plug-in output:

path : C:\Program Files\Microsoft SQL Server\150\DT

I have hell no of rows and my mid function is not working well :( can anyone explain how to get this fixed

thank me n forward for your help
 
will there always be a third /

do you have version 365v of excel - various TEXT functions available for that

how about
=TRIM(MID(SUBSTITUTE($A2,"\",REPT(" ",100)),200,100))

or will the string always start at the same place or do you have different examples
 

Attachments

  • extract between slash -ETAF.xlsx
    9.2 KB · Views: 4
If your data always started in: "C:\Program Files\"

Then, you can try this:

In B2, formula copied down:

=MID(A2,18,FIND("\",MID(A2,18,99))-1)

83847
 
will there always be a third /

do you have version 365v of excel - various TEXT functions available for that

how about
=TRIM(MID(SUBSTITUTE($A2,"\",REPT(" ",100)),200,100))

or will the string always start at the same place or do you have different examples
 
??? you seem to have copied/quoted my post with no comments ????

Some come with correct answers - I did manually in column P as service - the formula I applied in column N

I can’t able to apply full excel sorry mage is too sorry i
 
It did answered 80%

but some has path as below :

path:awesome:\Users\dv2\BMC Software\Control

But I need third string ‘BMC Software’
 
The path is irrelevant some are in third position some are second so it’s a headache no worries

All good don’t stress much! Rest I’ll make manual adjustments, thanks a bunch have a great weekend
 
third position some are second
any rules that could be applied to test if its 3rd or 2nd string needed

the 80% wrong - are they always \user\

C:\Program Files\Microsoft SQL Server\150\DT
so after the 2nd \

\Users\dv2\BMC Software\Control
after the 3rd \

maybe an IF combined with the index / textsplit
=INDEX(TEXTSPLIT(A3,"\"),4)

but a few more examples needed, and perhaps can be worked out to nearer 100% , if you want to - also you have not said what version of excel - so dont know if you have textsplit()
 
any rules that could be applied to test if its 3rd or 2nd string needed

the 80% wrong - are they always \user\

C:\Program Files\Microsoft SQL Server\150\DT
so after the 2nd \

\Users\dv2\BMC Software\Control
after the 3rd \

maybe an IF combined with the index / textsplit
=INDEX(TEXTSPLIT(A3,"\"),4)

but a few more examples needed, and perhaps can be worked out to nearer 100% , if you want to - also you have not said what version of excel - so dont know if you have textsplit()
I dint have textsplit in my version
 
This is from someone that deleted Excel 2010 as being unfit for purpose. Using 365
Code:
= MAP(list, Splitλ("\",3))
where MAP serves to feed the strings that comprise the list to the Lambda function 'Splitλ' one by one.
Code:
= LAMBDA(separator,instance,
    LAMBDA(string,
      INDEX(
        TEXTSPLIT(string, separator), ,
        instance)
    )
  )
 
Then try this formula to extract string after 2 or 3 slashes :

In B1 enter formula copied down:

=SUBSTITUTE(FILTERXML("<a><b>"&SUBSTITUTE(TRIM(MID(SUBSTITUTE(SUBSTITUTE(A1," ","^"),"\",REPT(" ",50)),99,98))," ","</b><b>")&"</b></a>","//b[contains(., '^')]"),"^"," ")

83860
 

Attachments

  • ExtractText.xlsx
    11.9 KB · Views: 1
Back
Top