0

我正在尝试删除 Google 表格中以下单元格中的所有 HTML 标记和注释:

<div class="prod-desc" itemprop="description">
                <div class="row">
                        <div class="col-md-8">


<p>This is a 100 count box of the ACC-DX01A Proximity Card to be used with any of our DX line of Access Control Readers. It is the size of a credit card so it can easily fit into your wallet. Use these like a proximity card and carry them on your key ring for easy access. </p>
<p> Please note: To add a DX Card or FOB to the DX Access Control System, you must use the Auto/Add Function. If you need assistance, FREE US based tech support is just a phone call away. </p>

                        </div>
                        <!-- Description Side Bar START   ************************************ -->
                        <div class="col-md-4"> <img src="/images_templ/Accesss-Control_product-image.jpg"> <span class="boxtitle ">Full Line of Access Control</span> <span style="font-size: 18px; font-family: inherit; font-weight: 400">Access Control Proximity Card Readers and Electronic Door Locks and more!</span> </div>
                        <!-- Description Side Bar END   ************************************ -->
                </div>
        </div>

所以理想情况下,输入应该是:

This is a 100 count box of the ACC-DX01A Proximity Card to be used with any of our DX line of Access Control Readers. It is the size of a credit card so it can easily fit into your wallet. Use these like a proximity card and carry them on your key ring for easy access.
Please note: To add a DX Card or FOB to the DX Access Control System, you must use the Auto/Add Function. If you need assistance, FREE US based tech support is just a phone call away.

Full Line of Access Control Access Control Proximity Card Readers and Electronic Door Locks and more!

我四处搜索找到了几个答案,但是,它们似乎都不适合我,也许是因为换行和回车?我不知道。我想要做的是删除所有 HTML 并在文本中保留所有换行符和回车符。以下是我关注的一些帖子:

删除 Google 表格单元格中的 HTML

https://superuser.com/questions/564727/html-tags-in-google-spreadsheet

4

2 回答 2

1

试试这样:

=ARRAYFORMULA(TEXTJOIN(CHAR(10), 1, 
 TRIM(SPLIT(REGEXREPLACE(A1, "</?\S+[^<>]*>", ), CHAR(10)))))

0

于 2019-10-10T13:21:40.890 回答
1

是的。除了@player0 给出的答案之外,您还可以使用“搜索和替换” ctrl+H ,然后只需粘贴您想要更改/删除的所有内容并将其替换为任何内容。它也适用于超过 1 个细胞。

它更费力,但如果需要,您可以定位整本书或范围。

于 2019-10-10T16:05:03.137 回答