简体   繁体   English

用于拆分文本的Excel公式

[英]Excel formula to split text

I have an Excel sheet like as per the below image.我有一个如下图所示的Excel sheet

在此处输入图片说明

From this Excel sheet I want to extract data like从这个Excel sheet我想提取数据,如

在此处输入图片说明

I used Excel formula like LEFT(D3,FIND("-",D3)-1) .我使用了像LEFT(D3,FIND("-",D3)-1)这样的 Excel 公式。 I also know SUBSTITUTE function to remove specific data like SUBSTITUTE(F3,".jar","") .我也知道SUBSTITUTE函数可以删除特定数据,如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.我无法一次实现所有这些,因为我是在 Excel 中完成所有这些的新手。 Is there any way to do this?有没有办法做到这一点?

Please help me.请帮我。 Thanks in advance提前致谢

You;re right on the mark with Left & Substitute.你是对的,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假设文件详细信息在单元格 A2 中,您可以在文件名和版本中输入以下公式

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 ".": #@!

Try this尝试这个

+---------------------+-----------------------------------------------------+-----------------+-------------------------------+--+ | +---------------------+---------------------------- --------------------------+-----------------+----- --------------------------+--+ | File Details |文件详情 | Find |查找 | Artifact name |神器名称 | version |版本| | | +---------------------+-----------------------------------------------------+-----------------+-------------------------------+--+ | +---------------------+---------------------------- --------------------------+-----------------+----- --------------------------+--+ | activation-1.1.jar |激活-1.1.jar | =MIN(SEARCH({0,1,2,3,4,5,6,7,8,9},A2&"0123456789")) | =MIN(搜索({0,1,2,3,4,5,6,7,8,9},A2&"0123456789")) | =MID(A2,1,B2-2) | =中(A2,1,B2-2) | =MID(A2,B2,LEN(A2)-LEN(C2)-5) | =MID(A2,B2,LEN(A2)-LEN(C2)-5) | | | +---------------------+-----------------------------------------------------+-----------------+-------------------------------+--+ +---------------------+---------------------------- --------------------------+-----------------+----- --------------------------+--+

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM