I have two files which I would like to compare and then manipulate in a way.
File1:
pictures.txt 1.1 1.3
dance.txt 1.2 1.4
treehouse.txt 1.3 1.5
File2:
pictures.txt 1.5 ref2313 1.4 ref2345 1.3 ref5432 1.2 ref4244
dance.txt 1.6 ref2342 1.5 ref2352 1.4 ref0695 1.3 ref5738 1.2 ref4948 1.1
treehouse.txt 1.6 ref8573 1.5 ref3284 1.4 ref5838 1.3 ref4738 1.2 ref4573 1.1
What I want is the file and the version number to be printed into a file between the two version numbers in shown in file1. So the output should be:
pictures.txt 1.3 ref5432 1.2 ref4244 1.1
dance.txt 1.4 ref0695 1.3 ref5738 1.2 ref4948
treehouse.txt 1.5 ref3284 1.4 ref5838 1.3 ref4738
Also, rdcwayx identified a possible bug in the awk for loop which no one seems to have picked up on:
$ awk 'BEGIN {for (i=1.5;i>=1.2;i-=0.1) print i}'
1.5
1.4
1.3
$ awk 'BEGIN {for (i=15;i>=12;i-=1) print i}'
15
14
13
12
In the first example there should be 4 outputs, however only 3, whilst in the 2nd one we get all 4.