如何在字符串中提取字符串 [英] How to extract piece of string within string

查看:129
本文介绍了如何在字符串中提取字符串的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个日志,我想在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


推荐答案

这里有几个选择。两者都围绕着使用查找功能(区分大小写)或
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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆