Entering edit mode
7.1 years ago
waqasnayab
▴
250
Dear Community,
My this question is the follow-up / extension of C: Copy Sample ID from VCF file to ID column
I have a file like:
rsid1:sample1,sample2,sample3
rsid2:sample1,sample5
rsid3:sample4, sample6
rsid4:sample6
Each line is paired with the second line, that is , rsid1 and rsid2 are paired, rsid3 and rsid4 are paired and so on. I want to print only those samples that are present in a pair, so the desired output would be:
rsid1:sample1
rsid2:sample1
rsids3:sample6
rsid4:sample6
or is it possible to get the direct output like this from a VCF file (answered by PIERRE in the above link, but last time I did not ask this pair feature).
Any help appreciated.
Thanks,
Waqas.
Pierre or the man who always has awk-one-liners for your case! :D
Yes, it worked really very well, in fact perfect..,,,,,!!!!
Thanks Pierre