How could I replace column 1 in File1
with column 2 in File2
, when a match is found?
File1
id1 36987
id2 75685
id3 12345
id4 12896
File2
id1 ID1
id2 ID2
id3 ID3
id5 ID5
I'd like to write this on another File3
, that should look like:
File3
ID1 36987
ID2 75685
ID3 12345
id4 12896
I'm currently (unsuccessfully) trying:
sed `File2.txt | awk '{print "-e s/"$1"/"$2"}'`<<< "File1.txt"