in reply to How to delete lines with similar data
Output:#!/usr/bin/perl -w use strict; my @regfile = <DATA>; my %uniques = (); foreach my $i (@regfile) { my ($email, $name, $date, $format) = split (/\|/, $i); $uniques{$email.$name.$date.$format}++; print "$email\|$name\|$date\|$format" unless $uniques{$email.$name.$date.$format} > 1; } __DATA__ dummy@fake.com|John|10-10-2000|XZXXXXXXXXX dummy2@fake.com|Joe|11-10-2000|XXXXXXXXXXX alone@dunno.com|Jim|10-09-2000|YYYYYYYYYYYYY dummy2@fake.com|Joe|11-10-2000|XXXXXXXXXXX
The key to the hash should be the concatenation of all pieces of information that will make your record unique.dummy@fake.com|John|10-10-2000|XZXXXXXXXXX dummy2@fake.com|Joe|11-10-2000|XXXXXXXXXXX alone@dunno.com|Jim|10-09-2000|YYYYYYYYYYYYY
_ _ _ _ (_|| | |(_|>< _|
|
|---|