【问题标题】:Google Sheets replace spaces with -, remove parentheses and periodsGoogle 表格用 - 替换空格,删除括号和句点
【发布时间】:2022-01-09 23:54:40
【问题描述】:

我正在尝试从 Google 表格中的某些数据生成要在 URL 中使用的字符串。

这是一个数字或行

Logan
Louisville
North Seattle (Lynnwood)
Mesa
Minneapolis
Nashville
National City
St. Paul (Oakdale)
Oklahoma City

我需要用 - 替换空格,然后删除所有句点或括号。 这就是我现在所处的位置,它适用于空格,但不确定句点和括号的位置

substitute(lower(A1)," ","-")

我会在 lower() 中使用 REGEXREPLACE 来查找句点和括号吗?

寻找输出

logan
louisville
north-seattle-lynnwood
mesa
minneapolis
nashville
national-city
st-paul-pakdale
oklahoma-city

谢谢

【问题讨论】:

  • 圣保罗奥克代尔?
  • @player0 错字,谢谢指出!

标签: arrays regex google-sheets excel-formula substitution


【解决方案1】:

尝试:

=INDEX(LOWER(REGEXREPLACE(REGEXREPLACE(A1:A, "[\(\).]", ), " ", "-")))

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-08-10
    相关资源
    最近更新 更多