如何提取字符串中的一段字符串 [英] How to extract piece of string within string
本文介绍了如何提取字符串中的一段字符串的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个日志,我想从中提取name="之后的任何内容.日志看起来像这样:
I have a Log from which I want to extract anything after "name= ". Log looks like this:
BC_WVM_FAIL: Rend wrong size for BCID 4608603 rend_id: 4608621 expected sz: 220459951 actual sz: 90816512 name: The Real Housewives Of Orange County - S10 Ep2
推荐答案
这里有几个选项.两者都围绕使用 FIND 函数(区分大小写)或SEARCH 功能(非区分大小写)用于从较长的文本字符串中定位要拼接的内容的起始位置.
You've got a few options here. Both center around using either the FIND function (case-sensitive) or the SEARCH function (non-case-sensitive) for locating the starting position of what to splice out of the longer text string.
=REPLACE(A1, 1, SEARCH("name:", A1)+LEN("name:"), "")
=MID(A1, SEARCH("name: ", A1)+LEN("name: "), 99999)
这篇关于如何提取字符串中的一段字符串的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文