【问题标题】:Google Docs Sheets - Strip text from resultGoogle Docs Sheets - 从结果中去除文本
【发布时间】:2015-05-28 05:58:58
【问题描述】:

我有这个代码:

=ImportXML("http://www.site.co.uk/content?q=test", "//div[@id='searchCount']")

在它返回的数据中:

Items 1 to 10 of 1,819

如何更改公式以去除“项目 X 到 X 的”,所以我只剩下最后的数字?

【问题讨论】:

    标签: xml excel google-sheets google-docs


    【解决方案1】:

    试试这个

    =INDEX(SPLIT(ImportXML("http://www.site.co.uk/content?q=test", "//div[@id='searchCount']")," "),1,COLUMNS(SPLIT(ImportXML("http://www.site.co.uk/content?q=test", "//div[@id='searchCount']")," ")))
    

    【讨论】:

      【解决方案2】:

      或者,这也可能有效:

      =REGEXEXTRACT(ImportXML("http://www.site.co.uk/content?q=test", "//div[@id='searchCount']"), "of (.+)$")+0
      

      【讨论】:

        猜你喜欢
        • 2022-01-10
        • 1970-01-01
        • 1970-01-01
        • 2022-11-16
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多