select unique names while removing the duplicates from a column I have a file with Ensembl gene and Transcript IDs :


  


I want to retain only the first entires from both the column so that the output looks like this:

ENSG00000003137 ENST00000001146
ENSG00000003402 ENST00000309955


and ignore the rest. 
Have tried awk awk '!a[$1$2]++' and versions of it. Nothing works.
Kindly suggest some way to get the desired output.

regards.
That sound like a job for a perl one-liner:

perl -ane 'unless(exists $seen{$F[0]}){print $_; $seen{$F[0]}++}'


Explanation: 
The input is read line-wise and printed back to the command line if the ID in the first column has not been seen before. 


perl -ane ' reads input line-wise and splits fields to array @F
unless(exists $seen{$F[0]}){ checks if ID exists in hash %seen and continues if that is not the case
print $_; prints the original input to STDOUT 
$seen{$F[0]}++}' adds the ID to the hash %seen