Is there a simple awk script to do the following?
I have a data file 1 such as:
FIELD1,FIELD2A,100,1000,10000
FIELD1,FIELD2A,101,2222,33333
FIELD1,FIELD2A,133,44444,5555
FIELD1,FIELD2,400,1,1
FIELD1,FIELD2E,166,1,1
and file 2 is like:
FIELD__1 FIELD2A 100 0.0 0.0 0.000000 1475
FIELD__1 FIELD2A 100 0.0 0.0 1.028590 1482
FIELD__1 FIELD2A 100 0.0 0.0 1.168080 1491
FIELD__1 FIELD2A 101 0.0 0.0 1.217630 1511
FIELD__1 FIELD2A 133 0.0 0.0 0.000000 1475
FIELD__1 FIELD2A 133 0.0 0.0 1.061950 1488
FIELD__1 FIELD2A 133 0.0 0.0 3.103750 2220
FIELD__1 FIELD2A 133 0.0 0.0 3.415240 2447
FIELD__1 FIELD2B 133 0.0 0.0 3.876910 2666
FIELD__1 FILED2C 133 0.0 0.0 4.153300 2890
FIELD__1 FIELD2D 133 0.0 0.0 5.156230 3773
FIELD__1 FIELD2E 166 0.0 0.0 0.000000 1475
I want to read file 1 fields 2 and 3 and if they are the same as file 2 fields 2 and 3 then I want to update file 2 fields 4 and 5 with values from file 1 fields 4 and 5.
Thanks for any assistance.
I have a data file 1 such as:
FIELD1,FIELD2A,100,1000,10000
FIELD1,FIELD2A,101,2222,33333
FIELD1,FIELD2A,133,44444,5555
FIELD1,FIELD2,400,1,1
FIELD1,FIELD2E,166,1,1
and file 2 is like:
FIELD__1 FIELD2A 100 0.0 0.0 0.000000 1475
FIELD__1 FIELD2A 100 0.0 0.0 1.028590 1482
FIELD__1 FIELD2A 100 0.0 0.0 1.168080 1491
FIELD__1 FIELD2A 101 0.0 0.0 1.217630 1511
FIELD__1 FIELD2A 133 0.0 0.0 0.000000 1475
FIELD__1 FIELD2A 133 0.0 0.0 1.061950 1488
FIELD__1 FIELD2A 133 0.0 0.0 3.103750 2220
FIELD__1 FIELD2A 133 0.0 0.0 3.415240 2447
FIELD__1 FIELD2B 133 0.0 0.0 3.876910 2666
FIELD__1 FILED2C 133 0.0 0.0 4.153300 2890
FIELD__1 FIELD2D 133 0.0 0.0 5.156230 3773
FIELD__1 FIELD2E 166 0.0 0.0 0.000000 1475
I want to read file 1 fields 2 and 3 and if they are the same as file 2 fields 2 and 3 then I want to update file 2 fields 4 and 5 with values from file 1 fields 4 and 5.
Thanks for any assistance.