If I have two files file1:Reference Position9058941197693370374992108275114940633114940633file2:Mapping  Reference Position Type    Length  Reference   Allele  Linkage Zygosity    Count1 mapping   877831  SNV 1   T   C       Homozygous  481 mapping   883625  SNV 1   A   G       Homozygous  231 mapping   905894  SNV 1   C   T       Heterozygous    411 mapping   909768  SNV 1   A   G       Homozygous  851 mapping   1153944 SNV 1   T   G       Heterozygous    651 mapping   1197693 SNV 1   G   A       Heterozygous    231 mapping   1276973 SNV 1   G   C       Heterozygous    41 mapping   1276974 Insertion   4   -   ACAC        Heterozygous    521 mapping   1277533 SNV 1   T   C       Homozygous  73I want the reference positions in both files to match and return the whole column in file 2 that matches with file 1.
match just one row in two files and return the whole column from file 2
linux;file management;bioinformatics
Using egrep should help. Try:grep -E '(905894|1197693|3703749|92108275|114940633)' file2This will check for an occurence of the pattern provided in file1. When testing it out, I got this for the results:[rkahil@xxxxxx ~]$ grep -E '(905894|1197693|3703749|92108275|114940633)' file21 mapping   905894  SNV 1   C   T       Heterozygous    411 mapping   1197693 SNV 1   G   A       Heterozygous    23