I have a two-column text file
Gene Description
AAA1 description_1
BBB1 description_2
BBB1 description_2_a
CCC1 description_3
...
I want a file that has only unique entries in the "Gene" column even if the description column is different. Example output
Gene Description
AAA1 description_1
BBB1 description_2
CCC1 description_3
...
I tried:
cut -f 1 file.txt | sort -u > output.txt
but output.txt
has only the Gene column but not the Description column. Can you suggest edits?