match two files and check if position of chrom is within exon region
Despite an awk solution is favored by the OP, here is an R solution. (The task, especially dealing with exon coordinates in file2, is rather complex for a straightforward awk solution, at least for me).

res &lt;- data.frame() # empty df for storing results

for (i in 1:nrow(file1)) {

  chr &lt;- file1[i,1] # get chr
  pos &lt;- file1[i,2] # get position of interest
  print("pos")
  print(pos)

  if(chr %in% file2$chrom) {

    file2_subset &lt;- file2[file2$chrom == chr,] # subset file2

    for(j in 1:nrow(file2_subset)) {

      # create exon start - exon end pairs

      exon_start &lt;- file2_subset[j,2]
      exon_start &lt;- as.numeric(unlist(strsplit(exon_start,",")))
      print(exon_start)

      exon_end &lt;- file2_subset[j,3]
      exon_end &lt;- as.numeric(unlist(strsplit(exon_end,",")))
      print(exon_end)

      # if position of interest lie within exons
      # need to be careful if start/end position are counted as exon

      if(any(pos &gt;= exon_start &amp; pos &lt;= exon_end)) {
        print(file1[i,])
        res &lt;- rbind(res, file1[i,]) # write line i from file1 if satisfies above conds
      }
    }
  }
}

&gt; res
  CHROM    POS REF ALT FATHER MOTHER DAUGHTER1 DAUGHTER2 DAUGHTER3 SON1 SON2          INFO
6  chr1 790590   C   T    0/1    0/1       0|0       0/1       0/1  0|0  1|1 AN=2184;AC=84