Hi Friends,
I have two input files
cat input1
chr1 100 200
chr1 200 300
chr2 300 400
cat input2
chr1 hello monday 10 20 . - . sometext
chr1 hello monday 20 30 . - . sometext
chr2 hello monday 30 40 . - . sometext
Now, I want to replace $1, $4 and $5 of input2 with $1, $2 and $3 of input1.
So, my final output would be
chr1 hello monday 100 200 . - . sometext
chr1 hello monday 200 300 . - . sometext
chr2 hello monday 300 400 . - . sometext
---------- Post updated at 10:07 AM ---------- Previous update was at 09:50 AM ----------
Thanks all.
I found the answer.
paste input2 input1 | awk '{print .....}'