I am not sure about the first stuff or that I understand the duplicate entry part but have you looked at the UNIX command uniq(1). Zarth Arn