I have two files which both follow the same pattern:
TEST CASE 1: 0.004 seconds
TEST CASE 2: 0.043 seconds
TEST CASE 3: 0.234 seconds
TEST CASE 4: 0.564 seconds
....
What I’m trying to do is calculate the speedup for each test case, which is done by taking the
value from one file and dividing it with the corresponding value in the other file.
Is there a simple way of doing that using awk?
I managed to come up with my own solution by using
pasteto merge the two result files. Then theawkscript became really simple, and the test cases are sorted correctly.The
grepis there to get the expected input topasteas the lines are taken from a file which contains a lot of other information that I don’t want. If the expected output is already available in a separate file (as I stated in the question), then the command becomesThis gives as output: