Finding a range of numbers of a file in another file using awk
问题 I have lots of files like this: 3 10 23 . . . 720 810 980 And a much bigger file like this: 2 0.004 4 0.003 6 0.034 . . . 996 0.01 998 0.02 1000 0.23 What I want to do is find in which range of the second file my first file falls and then estimate the mean of the values in the 2nd column of that range. Thanks in advance. NOTE The numbers in the files do not necessarily follow an easy pattern like 2,4,6... 回答1: Since your smaller files are sorted you can pull out the first row and the last row