This question: https://unix.stackexchange.com/questions/20322/replace-string-with-contents-of-a-file-using-sed replaces a fixed string in file1 with the contents of file 2.
I want to do this the other way around plus an inversion.
If I have file1:
A:B
B:B
C:
D:
E:A
and file2:
D
E
:
then I want to be left with
:
:
:
D:
E:
If anyone has any pointers that would be great. Bonus points if this can be done on a specific column of a file1 while preserving the rest of the file1.
i.e. If I have three columns:
A:B A:B A:B
B:B B:B B:B
C: C: C:
D: D: D:
E:A E:A E:A
I would end up with (target column 2)
A:B : A:B
B:B : B:B
C: : C:
D: D: D:
E:A E: E:A