我有一个包含单列的file1:
24.5829
30.0909
26.7116
26.9422
27.9492
32.1318
35.6075
46.4325
39.6898
31.729
31.5597
35.776
...
我有另一个文件e2包含:Average = 36.8324
我想将file1的所有值除以file2中的平均值,然后乘以2,并将它们打印到新的file3中:
ploidy
1.33485192385
1.63393642554
1.45044037315
...
Using awk:
awk 'NR == FNR { avg = $3; print "ploidy"; next }
{ print ($0 / avg) * 2.0 }' file2 file1 > file3