Trying to get a bit more out of the command line:
I have a file:
CHR25 1192279 Y Exonic NA exon 2 [1/1] 1192145 1192322
CHR25 1192279 Y Exonic NA CDS 2 [1/1] 1192145 1192322
CHR25 1739394 Y Exonic NA CDS 2 [1/2] 1739294 1739456
I want to get unique lines based on column 2. I have done
cat file | cut -f 2 | uniq > grepfile
but am unsure of how to now get one match per line using grep -f
as I previously have. Using -m1 or | head -n 1
only gives the first matching line. I want the first line to match each line in 'grepfile'.
Look forward to answers=)