目前,我正在处理包含数十万个xml条目的巨大文件,在更改它们之后,我必须将它们作为新数据库上传到特定系统中,文件内容如下:
<Row ss:AutoFitHeight="0">
<Cell><Data ss:Type="String">Product</Data></Cell>
<Cell><Data ss:Type="String">Home > Connectors > Power Entry</Data></Cell>
<Cell><Data ss:Type="Number">10430</Data></Cell>
<Cell><Data ss:Type="String">CAMDEN-BOSS CONTACT, 6AWG, 75A CBCAG14</Data></Cell>
<Cell><Data ss:Type="String">CONTACT, 6AWG, 75A; Connector Mounting:Cable; Contact Termination:Crimp; Current Rating:75A; SVHC:No SVHC (18-Jun-2012); Series:CBC; Voltage Rating:600V; Flammability Rating:UL94 V0; Wire Area Size Max:11mm; Wire Size AWG Max:6AWG; Wire Size AWG Min:6AWG<br /><br /><strong>Price for pack of: 1</strong><br /><br /><strong>Country Of Origin: CN</strong><br /><br /><a href="http://LALA.co.uk/datasheets/1508502.pdf"><img alt="" src="/ekmps/shops/LALA/resources/Design/icon-pdf.gif" style="width: 16px; height: 16px;" />&nbsp;Technical Data Sheet</a><br /></Data></Cell>
</Row>我的工作是删除所有的条目,其中有任何链接到.pdf文件,上面的例子中有它,所以将被留下,但如果没有"http://LALA.co.uk/datasheets/1508502.pdf“在描述中它应该已经被删除(所有行),我可以使用不同的东西,从C#到..所以解决方案的类型并不重要,有没有人能给我一些建议?
发布于 2012-12-21 19:26:10
在Notepad++中查找(Ctrl+F)
<Row[^>]*>((?!\.pdf).)*?</Row>替换为
(leave blank)必须选中“正则表达式”和".匹配换行符“框
https://stackoverflow.com/questions/13987291
复制相似问题