I have two files like this:
File1:
-54.005 -67.405 0.1 -54.05 -68.7833 0.2 -54.05 -68.7333 0.3
File2:
-54.005 -67.4050 70 12.7 -54.05 -68.7833 167 12.5 -54.05 -68.7333 205 12.6
I would like to get a file that sums column 3 from file1
with column 4 from file2
with the following output:
-54.005 -67.4050 70 12.8 -54.05 -68.7833 167 12.7 -54.05 -68.7333 205 12.9
I tried with the following command:
cat file1 | awk '{n=$3; getline <"file2"; print "" $1,$2,$3,n+$4}' > output.txt
but it did not succeed and I couldn't find this type of answer in this site.