[PerlChina] 请教一个问题,脚本编程时候的大数据量比较问题

Achilles Xu formalin14 at gmail.com
Thu Oct 25 23:37:31 PDT 2007


cat aaa.log | grep keyword | awk '{print $6}' | sort | uniq -c

在07-10-26,Jester <jester at perlchina.org> 写道:
>
> 说的不太清楚,到达比较什么?最好给点example data。
> 做比较,最好用hash,用array需要大量的循环,非常慢的。
>
> Jester
>
> ----- Original Message -----
> From: "zongzi" <honghunter at gmail.com>
> To: <python-chinese at lists.python.cn>; <china-pm at pm.org>
> Sent: Friday, October 26, 2007 12:35 PM
> Subject: [PerlChina] 请教一个问题,脚本编程时候的大数据量比较问题
>
>
> > 我现在需要从十几万条数据(文本文件中的行)中,提取有特定关键字的记录,然后刷选出这些记录的特定位置重复的记录。
> >
> > 这是一个桌面使用的脚本,系统维护工作中使用的。
> >
> > 我本来是想直接放进数组,然后一个一个比较的。
> >
> > 但是突然觉得那样就算不会超出数组大小的上限,也是非常没有效率的。
> >
> > 所以想请教一下各位,有啥好的处理思路吗?
> >
> >
> >
> > --
> > 这是一个有钱人的世界,与我的世界截然不同!
> > blog:http://www.dps4e.com/b/ & http://blog.dps4e.com
> > 饭否? http://fanfou.com/zongzi
> >
>
>
>
> --------------------------------------------------------------------------------
>
>
> > _______________________________________________
> > China-pm mailing list
> > China-pm at pm.org
> > http://mail.pm.org/mailman/listinfo/china-pm
> _______________________________________________
> China-pm mailing list
> China-pm at pm.org
> http://mail.pm.org/mailman/listinfo/china-pm




-- 
---------------------------
Achilles Xu
http://www.lostcode.org
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.pm.org/pipermail/china-pm/attachments/20071026/5e77bdf4/attachment.html 


More information about the China-pm mailing list