How could I replace column 1 in File1 with column 2 in File2, when a match is found? File1id1 36987id2 75685id3 12345id4 12896File2id1 ID1id2 ID2id3 ID3id5 ID5I'd like to write this on another File3, that should look like: File3ID1 36987ID2 75685ID3 12345id4 12896I'm currently (unsuccessfully) trying: sed `File2.txt | awk '{print -e s/$1/$2}'`<<< File1.txt 
Replace columns using a shell
sed;awk
With awk$ awk 'NR==FNR {a[$1]=$2; next}; a[$1] {$1=a[$1]} 1' File2 File1ID1 36987ID2 75685ID3 12345id4 12896