Find and replace the line in text file

I have two files
a.txt
b.txt
I want to find a line in a.txt and replace by another line from b.txt

 a.txt
asfsdfsfsfdfsf
asfwererfgdgf
wrerwetretfdg
 b.txt
werdfgdfgf
werergfdgd
sfdfgfgfgfgg

i want to replace the 1st line of a.txt by 1st line of b.txt

i want out put as

a.txt
werdfgdfgf
asfwererfgdgf
wrerwetretfdg

i want the script for it.pls help

( head -n 1 a.txt
tail -n +2 b.txt ) > c.txt

Hi guys any codes for the following question...in order to replace the line in file.

If this solution doesn't work for you, please explain why instead of repeating your question.

Please be specific with your question. How do you want to find the line in first file, is it by pattern or line number and which line should get replaced in 2nd file???

ex -s a.txt <<EOF
   1 d
   0 r !head -1 b.txt
   wq
EOF