I have 2 files
file1sample
-------------------------
NODE / 563 90. .0 .0
NODE / 564 80. .0 .0
NODE / 565 70. .0 .0
NODE / 566 60.0 .0 .0
BEAM / 563 5 5 8
file2sample
-------------------------------
563
564
568
so what I want to do is search if to read each line of file2 and check file1 lines if starting with node and matching the same number after NODE then replace the last value of this line with an added value of 2 for example
so finally file1 will be looking like this output
output
----------------------------
NODE / 563 90. .0 2
NODE / 564 80. .0 2
NODE / 565 70. .0 .0
NODE / 566 60.0 .0 .0
BEAM / 563 5 5 8
I did something but instead i printed new result without deleting the old ones
file1sample
-------------------------
NODE / 563 90. .0 .0
NODE / 564 80. .0 .0
NODE / 565 70. .0 .0
NODE / 566 60.0 .0 .0
BEAM / 563 5 5 8
file2sample
-------------------------------
563
564
568
so what I want to do is search if to read each line of file2 and check file1 lines if starting with node and matching the same number after NODE then replace the last value of this line with an added value of 2 for example
so finally file1 will be looking like this output
output
----------------------------
NODE / 563 90. .0 2
NODE / 564 80. .0 2
NODE / 565 70. .0 .0
NODE / 566 60.0 .0 .0
BEAM / 563 5 5 8
I did something but instead i printed new result without deleting the old ones