0

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?

Andrea Corbellini
  • 17,339
  • 3
  • 53
  • 69
Ssank
  • 3,367
  • 7
  • 28
  • 34

0 Answers0