删除以特定字符开头和结尾的任何子字符串

发布于 2025-01-29 02:43:25 字数 410 浏览 2 评论 0原文

我的字符串在Google表中看起来像这样:

在A1

中,信息技术#ICT / Computer < / code>

在A2

中,农业#农业 /农业 /农业allied,NGO#NGO#NGO / nongo / non-Profit,项目管理#项目管理

我需要删除以开始的所有内容,并以

结束逗号像这样

B1

ICT / Computer

B2

Agriculture / Agro-Allied, NGO/Non-Profit, Project Management

I have strings that looks like this in google sheets:

In A1

,information-technology#ICT / Computer

In A2

,agriculture#Agriculture / Agro-Allied,ngo#NGO/Non-Profit,project-management#Project Management

I need to remove everything that begins with , and ends with # including these two characters

If possible the output to be separated by a comma like so

B1

ICT / Computer

B2

Agriculture / Agro-Allied, NGO/Non-Profit, Project Management

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

终陌 2025-02-05 02:43:25

尝试:

=ARRAYFORMULA(REGEXREPLACE(TRIM(FLATTEN(QUERY(
 TRANSPOSE(IF(IFERROR(SPLIT(A1:A3, "#"))<>"", 
 REGEXREPLACE(SPLIT(REGEXREPLACE(A1:A3, "(#)", "$1♥"), 
 "♥"), "(,.+)", )&",", )),,9^9))), "^, |,$", ))

try:

=ARRAYFORMULA(REGEXREPLACE(TRIM(FLATTEN(QUERY(
 TRANSPOSE(IF(IFERROR(SPLIT(A1:A3, "#"))<>"", 
 REGEXREPLACE(SPLIT(REGEXREPLACE(A1:A3, "(#)", "$1♥"), 
 "♥"), "(,.+)", )&",", )),,9^9))), "^, |,
quot;, ))

enter image description here

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文