radix655
asked on
appending to a line that doesn't match grep
I have a file which contains:
ss1 dest1 dest2 dest3
ss2 dest2 dest4
I get the dest2 for ss1 say from reading another file.
Then I will not append dest2 to ss1
Output file:
ss1 dest1 dest2 dest3
ss2 dest2 dest4
If I get the dest4 for ss1 say
Output file:
ss1 dest1 dest2 dest3 dest4
ss2 dest2 dest4
How to achieve this? Please suggest.
ss1 dest1 dest2 dest3
ss2 dest2 dest4
I get the dest2 for ss1 say from reading another file.
Then I will not append dest2 to ss1
Output file:
ss1 dest1 dest2 dest3
ss2 dest2 dest4
If I get the dest4 for ss1 say
Output file:
ss1 dest1 dest2 dest3 dest4
ss2 dest2 dest4
How to achieve this? Please suggest.
ASKER CERTIFIED SOLUTION
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.