Is it possible to match fields from two different files using grep? for instance, if I have a file1. i want to match the field POS from the two files if there is a macth i output only the lines that match like
1 10366 rs58108140 G A
1 51954 rs185832753 G C
file 1
#CHROM POS ID REF ALT QUAL
1 10366 rs58108140 G A
1 10611 rs189107123 C G
1 51954 rs185832753 G C
1 13327 rs144762171 G C
1 13957 . TC T 28
1 13980 rs151276478 T C
file 2
#CHROM POS ID REF ALT QUAL
1 10366 rs58108140 G A
1 51935 rs181754315 C T
1 51954 rs185832753 G C
1 52058 rs62637813 G C
1 52144 rs190291950 T A
1 52238 rs150021059 T G
1 54353 rs140052487 C A
bcftools
. You might want to check out our sister site: Bioinformatics.