Reputation: 1749
I have an Excel sheet
like as per the below image.
From this Excel sheet
I want to extract data like
I used Excel formula like LEFT(D3,FIND("-",D3)-1)
.
I also know SUBSTITUTE
function to remove specific data like SUBSTITUTE(F3,".jar","")
.
I am not able to implement all of this at a time as I am completely new to do all this in Excel. Is there any way to do this?
Please help me. Thanks in advance
Upvotes: 0
Views: 361
Reputation: 175
You;re right on the mark with Left & Substitute. Just add on a bit of creativity. If we can assume that version is displayed after the final "-" and extension is after the final ".", we use use place holder characters to track the final "-" & "." of each File Detail.
Assume Assuming FileDetails are in Cell A2, you can input the below formula for FileName & Version in
Cell B2:
=LEFT(A2,SEARCH("!@#@!",SUBSTITUTE(A2,"-","!@#@!",LEN(A2)-LEN(SUBSTITUTE(A2,"-",""))))-1)
Cell C2:
=MID(A2,SEARCH("!@#@!",SUBSTITUTE(A2,"-","!@#@!",LEN(A2)-LEN(SUBSTITUTE(A2,"-",""))))+1,SEARCH("#@!",SUBSTITUTE(A2,".","#@!",LEN(A2)-LEN(SUBSTITUTE(A2,".",""))))-(SEARCH("!@#@!",SUBSTITUTE(A2,"-","!@#@!",LEN(A2)-LEN(SUBSTITUTE(A2,"-",""))))+1))
Placeholder for final "-": !@#@!
Placeholder for final ".": #@!
Upvotes: 1
Reputation: 11298
Try this
+---------------------+-----------------------------------------------------+-----------------+-------------------------------+--+ | File Details | Find | Artifact name | version | | +---------------------+-----------------------------------------------------+-----------------+-------------------------------+--+ | activation-1.1.jar | =MIN(SEARCH({0,1,2,3,4,5,6,7,8,9},A2&"0123456789")) | =MID(A2,1,B2-2) | =MID(A2,B2,LEN(A2)-LEN(C2)-5) | | +---------------------+-----------------------------------------------------+-----------------+-------------------------------+--+
Upvotes: 0