Passing variable as an input file to AWK comand

Hi,

I would like to compare 2 files using awk, which I can do by using:

awk 'NR==FNR{a[$1];next} (NR > 32 && $2 in a) {print $0}' File1 and File2. 

If the name of the File1 is in another file (for example, column 4 in File 3) then how can I pass this column 4 to the awk command.

Thanks in advance.

Kind regards,
Ezhil

maybe something like this ?

mycol=1
myfile=File1
awk -v c="$mycol" 'NR==FNR{a[$(c)];next}(NR>32)&&($2 in a){print $0}' $myfile File2

If you are willing to check col 4 of File3 against col 2 of File2 :

mycol=4
myfile=File3
awk -v c="$mycol" 'NR==FNR{a[$(c)];next}(NR>32)&&($2 in a){print $0}' $myfile File2