I have two files. The first file has 11 columns, for example:1 2 3 4 5 6 7 8 9 10 11The second has 10 columns and might look like this:11 22 33 44 55 66 77 88 99 100What I want to do is look at file1, and if column 7 is some value, for example say it's between 14 and 15, then replace column 9 of file1 with the the value of column 9 from file2. So in my example above, file1 would be rewritten as:1 2 3 4 5 6 7 8 99 10 11Checking to see if a column is between a certain value is trivial: awk '$7 < 15 && $7 >= 14However, I'm having problems replacing column 9 of file1 with the value from the file2. file1 is NOT necessarily just one row. It could have any number of rows, and in every instance where the value is between 14 and 15 column 9 needs to be replaced. If the value is less than 14 or greater than 15 then the columns should remain as is. I don't believe this should be difficult, but I'm not having any luck. Help would be appreciated, and thanks in advance!
Exchanging One Column From File1 with files from File2
shell script;text processing;sed;awk