Page 1 of 1

Unique records from 2 columns

PostPosted: Thu Oct 07, 2010 10:28 am
by Ajaysingh007
Requirement: To get the unique rows from 2 columns of a file

1. No records from col-1 if the value is occuring more than once in col-1.
2. No records from col-2 if the value is occuring more than once in col-2.

Example of input is given below:

Col-1 Col-2
-------------
A1 B1
A1 B2
A2 B3
A3 B3
A4 B4
A5 B5
A6 B1
A1 B6
A7 B7
A8 B8

Sample expected Output:

Col-1 Col-2
-------------
A4 B4
A5 B5
A7 B7
A8 B8

Re: Unique records from 2 columns

PostPosted: Fri Oct 08, 2010 12:03 am
by dick scherrer
Hello and welcome to the forum,

One way is to copy the file eliminating duplicates on col1 and then use that output to eliminate the duplicates on col2. This will be the set of records you want.