我在 Excel 中有一列描述。这些描述是 HTML 格式,需要通过删除所有 HTML 标记将该 HTML 转换为纯文本。
我不了解如何使用 Excel,因此我研究的替代方法是使用 fgetcsv php 函数和 html2text,然后导出为 Excel。
如果 Excel 上有一些设置/VBA 代码可以解决问题,那么这可能是一个冗长的解决方案。
欢迎任何帮助。
Excel 中的 HTML 数据示例:
<p> <strong><span style="font-size: 16px"><u>Socket & See LTKIT10 Lamp Test Adaptor Kit</u></span></strong> </p> <p> This fantastic product from Socket & See is ideal for Electricians testing light fittings. </p> <p> The Socket & See LTKIT10 is five adaptors that allow for easy connection and testing at light fittings: </p> <p> LTBC 02, LTES 04, LTMBC 06, LTMES 08, LTGU 10 </p> <p> Presented with 2 x 120cm, 4mm test leads in a protective carry pouch. </p> <br/>
<p> <strong>Features of Socket & See LTKIT10:</strong> </p> <ul> <li>Allows easy, safe connection to light fittings </li> <li>The fastest way to check insulation/continuity/loop/polarity </li> <li>High quality low ohn 4mm connectors </li> <li>Safer and saves time: leave the light fitting in place </li> <li>Easier/better connection allows hands-free </li> <li>No broken connections </li> <li>Great for use in awkward/high situations </li> <li>No damage to fittings</li></ul> <br/> <p> <strong>What's included:</strong> </p>
<p> Bayonet Fitting, GU10, Small Edison Screw, Small Bayonet Fitting, Edison Screw Fitting, 2 x 120cm, 4mm Test Leads, Protective Carrier Pouch<br /> </p>
答案1
复制所有标签和文本,粘贴到文本文件中,将扩展名文件从txt更改为html,用浏览器打开,从网页复制内容并粘贴到excel中。