in reply to How to parse a file with emails and IP's and output a sorted list with a total count
>perl -ane "my ($email,$ip)=split(/:/,$F[9]); push @{$h{$email}},$ip}{ +print qq|$_ => |,join(qq|,|,@{$h{$_}}),qq|\n| for sort keys %h" YOUR- +FILE.txt #--- Output--- fred@example.com => 192.168.8.8 harry@example.com => 192.168.10.5 joe@example.com => 192.168.250.251,192.168.5.23,192.168.5.23 sally@example.com => 192.168.10.28
"Software interprets lawyers as damage, and routes around them" - Larry Wall
|
|---|