- foreach original file - $linenum = 1; - while not eof - append the line to file "line${linenum}.dat" - $linenum++; - end - end - foreach line file - Compare num of lines returned by 'cat line###.dat | sort | uniq' with the number of lines in line###.dat. If they're different, there are duplicate records. - end