I have something like this
element1,12 element2,10 element3,5
IN element1,8 element3,5
and I want to modify file1 and obtain:
element1,20 element2,10 element3,10
The first line from file2 contains "IN" that, means I want to make an addition. If it would have been "OUT" instead, the values should be subtracted and file1 should have looked like this:
element1,4 element2,10 element3,0
I have to work with awk, grep, sed. Thx a lot!