Re: How to promote the efficiency

2005-12-08 Thread Xavier Noria
On Dec 8, 2005, at 9:37, Jennifer Garner wrote: hi,lists, I have a file which is so large,which looking as: 61.156.49.18:28360 61.183.148.130:27433 222.90.207.251:25700 202.117.64.161:25054 218.58.59.73:24866 221.233.24.9:22507 222.187.124.4:21016 ... and more than 4500 lines. Is the ti

Re: How to promote the efficiency

2005-12-08 Thread Xavier Noria
On Dec 8, 2005, at 11:44, Xavier Noria wrote: On Dec 8, 2005, at 9:37, Jennifer Garner wrote: hi,lists, I have a file which is so large,which looking as: 61.156.49.18:28360 61.183.148.130:27433 222.90.207.251:25700 202.117.64.161:25054 218.58.59.73:24866 221.233.24.9:22507 222.187.124.4:2101

Re: How to promote the efficiency

2005-12-08 Thread Jennifer Garner
Sorry, the file is more than 900M, too large to download. I have run it for one day,and still have nothing to output.Crying... I think maybe some arithmetic is useful for me,and now I'm thinking over it. On 12/8/05, Xavier Noria <[EMAIL PROTECTED]> wrote: > > On Dec 8, 2005, at 9:37, Jennifer Gar

Re: How to promote the efficiency

2005-12-08 Thread Ing. Branislav Gerzo
Jennifer Garner [JG], on Thursday, December 8, 2005 at 19:21 (+0800) typed the following: JG> Sorry, the file is more than 900M, too large to download. JG> I have run it for one day,and still have nothing to output.Crying... JG> I think maybe some arithmetic is useful for me,and now I'm thinking o

RE: How to promote the efficiency

2005-12-08 Thread Charles K. Clarkson
Jennifer Garner wrote: : open (FILE,$file) or die "$!"; : while() : { : next if /unknown/o; : next if /^192\.168\./o; : chomp; : my ($ip,$num) = split/:/,$_; : if ($ip =

Re: How to promote the efficiency

2005-12-08 Thread Shawn Corey
Jennifer Garner wrote: hi,lists, I have a file which is so large,which looking as: 61.156.49.18:28360 61.183.148.130:27433 222.90.207.251:25700 202.117.64.161:25054 218.58.59.73:24866 221.233.24.9:22507 222.187.124.4:21016 ... and more than 4500 lines. the part after ":" is no use for me,

Re: How to promote the efficiency

2005-12-08 Thread John W. Krahn
Jennifer Garner wrote: > hi,lists, Hello, > I have a file which is so large,which looking as: > > 61.156.49.18:28360 > 61.183.148.130:27433 > 222.90.207.251:25700 > 202.117.64.161:25054 > 218.58.59.73:24866 > 221.233.24.9:22507 > 222.187.124.4:21016 > ... > > and more than 4500 lines. > >

Re: How to promote the efficiency

2005-12-08 Thread Jennifer Garner
Thank you for John.I think your method would be much faster than mine. Now I'm going to rewrite this program with C language,but I'll test it using all the ways given by everyone here.Thanks. On 12/8/05, John W. Krahn <[EMAIL PROTECTED]> wrote: > > Jennifer Garner wrote: > > hi,lists, > > Hello,

Re: How to promote the efficiency

2005-12-08 Thread Dr.Ruud
Jennifer Garner schreef: > I have a file which is so large,which looking as: > > 61.156.49.18:28360 > 222.187.124.4:21016 > and more than 45,000,000 lines. > > the part after ":" is no use for me, I only need the IP. You could first convert the file to integers, so from 20 bytes per line down to

Re: How to promote the efficiency

2005-12-08 Thread Bob Showalter
John W. Krahn wrote: if ( $2 < 128 ) { $low{ $1 }++; } else { $high{ $1 }++; } $total{ $1 }++; Why track all three? You could just track (say) low and total, and derive high as (total - low) at print time. -- To unsubscribe, e-mail: [EMAIL PROTECT

Re: How to promote the efficiency

2005-12-08 Thread Jennifer Garner
Hi,John I think you have understanded wrongly with my meaning. The result of $low{ $1 }++ is no use for me.I just want the frequency of IP exists. For example, if there are some IPs exists in '22.33.44.0' : 22.33.44.11 22.33.44.22 22.33.44.22 22.33.44.33 22.33.44.33 22.33.44.44 22.33.44.55 Now

Re: How to promote the efficiency

2005-12-08 Thread Chris Devers
On Fri, 9 Dec 2005, Jennifer Garner wrote: > I think you have understanded wrongly with my meaning. > The result of $low{ $1 }++ is no use for me.I just want the frequency of IP > exists. > For example, if there are some IPs exists in '22.33.44.0' : > > 22.33.44.11 > 22.33.44.22 > 22.33.44.22 >

Re: How to promote the efficiency

2005-12-08 Thread John W. Krahn
Jennifer Garner wrote: > Hi,John Hello, > I think you have understanded wrongly with my meaning. > The result of $low{ $1 }++ is no use for me.I just want the frequency of IP > exists. > For example, if there are some IPs exists in '22.33.44.0' : > > 22.33.44.11 > 22.33.44.22 > 22.33.44.22 > 2

Re: How to promote the efficiency

2005-12-08 Thread Jennifer Garner
Now I have resolved this problem,still using perl. Just a little modification to that code,shown as below: foreach my $file (@files) { open (FILE,$file) or die "$!"; while() { next if /unknown/o; next if /^192\.168\./o; next unless /