in reply to Re^2: How to manage a big file
in thread How to manage a pattern matching & counting with big data file
algorithm:open IN,'<1'; while (<IN>) { $a = 1 if /Endpoint/; $b = 1 if /-/ and $a; if($a and $b){ if(/^\s+(.+)\s\(/){ $h{$1}{'x'} = ++$x if ! exists $h{$1}; $r .= $h{$1}{'x'}."."; } } $a = 0, $b = 0, ++$r{$r}, $r = '' if /data arrival time/ and $ +b; } close IN; foreach (sort keys %r) { print "$_: $r{$_}\n"; }
which means I copied your example file eight times in my '1' file1.2.2.3.3.4.4.5.6.7.8.9.10.10.11.11.12.12.: 8
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: How to manage a big file
by Anonymous Monk on Apr 23, 2014 at 10:04 UTC |