我有两个这样的txt文件
file1.txt
>100kb
ENSG00000004534
ENSG00000006453
ENSG00000011105
ENSG00000011275
ENSG00000014164
ENSG00000018408
ENSG00000028277
ENSG00000029534
ENSG00000039139
ENSG00000039560
file2.txt
Chromosome Start End Strand Gene Name n. Totaln X Y Z
chr6 143495847 143497388 - fuca2 ENSG00000001036 6 6 0.019896973 0.047572512 0.021542861
chr6 143497497 143501931 - fuca2 ENSG00000001036 5 6 0.223448446 0.048568393 0.13196303
chr6 143502122 143502354 - fuca2 ENSG00000001036 4 6 0.016900261 0.020203774 0
chr6 143502565 143503912 - fuca2 ENSG00000001036 3 6 0.019807321 0.04735816 0.042891587
chr6 143504252 143507236 - fuca2 ENSG00000001036 2 6 0.646528636 0.289839866 0.568757988
chr6 143507424 143511410 - fuca2 ENSG00000001036 1 6 0.730370424 0.363806977 0.285561993
chr1 24415904 24419290 + nipal3 ENSG00000001461 1 10 2.226799058 1.355237649 1.731537131
chr1 24419640 24440171 + nipal3 ENSG00000001461 2 10 12.37756228 10.31381565 11.11609581
chr1 24440240 24442054 + nipal3 ENSG00000001461 3 10 0.339855898 0.334590043 0.216452329
chr1 24442226 24445184 + nipal3 ENSG00000001461 4 10 0.34341861 0.169048777 0.349954241
我想获取一个新文件,该文件针对file1.txt中的每个巧合显示file2.txt中的所有cols
到目前为止,我已经尝试过
awk 'NR==FNR{a[$1];next}$6 in a{print}' file1.txt file2.txt >proof
但是它不起作用。有什么建议么?