lzr80 发表于 2014-5-21 16:31:44

如何清除空词条

盘里有个worldbook dictionary词库,每个词条都有一个重复的空白词条,只有词头无内容,想把空白词条清除,不知道用什么正则?

houbible 发表于 2014-5-21 21:57:22

期望高手出马指教了,我也顺带学习下。

itarcy 发表于 2014-5-23 13:42:25

有截图或者代码不

mitkyg 发表于 2014-5-23 17:13:17

我用了一个很笨的方法,用lingvo编译之后再反编译即可。{:4_91:}

lzr80 发表于 2014-5-23 19:18:29

本帖最后由 lzr80 于 2014-5-23 20:04 编辑

附件传不上来,词库wbd.mdx和用getdict转出来的源文件world book.rar在网盘我的目录里。

lzr80 发表于 2014-5-23 19:23:40

楼上两位道兄请出手{:4_97:}

lzr80 发表于 2014-5-23 19:59:52

1984
★<font color="blue">1984</font><br>

<br>    a date symbolizing a totalitarian society of the future in which truth and freedom are suppressed and people live in a totally regimented and dehumanized state.
<br>    <font color="green">△Ex. Throughout the campaign, the political uses of television advertising and packaging of candidates were heralded ... by doomsayers as the ominous forerunner of 1984 (Time). </font>
</>
1984
★<font color="blue">1984</font><br>

</>
2
★<font color="blue">2</font><br>
4-D, noun.
</>
2
★<font color="blue">2</font><br>
4-D, noun.
<br>    a poisonous, crystalline substance used to kill weeds.
</>
2
★<font color="blue">2</font><br>
4,5-T, noun.
<br>    a poisonous, crystalline substance used to kill weeds.
</>
2
★<font color="blue">2</font><br>
4,5-T, noun.
</>

上面是开头几个词的代码

houbible 发表于 2014-5-23 21:03:07

itarcy能关注该贴,真好啊,期望能指点了。谢谢itarcy!

itarcy 发表于 2014-5-23 21:09:00

空白行啊?\n\n替换为\n

lzr80 发表于 2014-5-23 23:23:47

不是空白行,是这样

lzr80 发表于 2014-5-23 23:37:43

转换时显示28万词,实际是14万,另外14万是重复的,只有词头,无内容。

lzr80 发表于 2014-5-23 23:42:16

mitkyg兄不知修改完成没,可否发出来?

itarcy 发表于 2014-5-23 23:42:42

哦,这种啊,这种怕是会误杀(有的没内容的排在前面,有的排在后面;而且行数也不固定),看大人们有没办法

lzr80 发表于 2014-5-24 00:08:30

这个词库文本来源网上,可能原文件有问题

ryuya 发表于 2014-5-24 11:47:57

簡單講 正則搞不定 Excel 可搞定

lzr80 发表于 2014-5-24 16:36:38

道兄能否讲一下

ryuya 发表于 2014-5-24 20:55:14

正則做不到的比對 IF函數可以辦到
加上排序、移除重複
能用的手段很多

再來就是要處理二十萬筆的數據
Excel 版本不能太舊
页: [1]
查看完整版本: 如何清除空词条