replaying a record count with another record count

i use unix command to take the record count for a file1
awk 'END{print NR}' filename

i already have a file2 which conatin the count like
...
..
rec_cnt=100
..
..
I want to replace the record in the file2 using the record i take from file1.
suggest me some simple ways of doing it
thanks

This should give you the desired output:

awk '
NR==FNR{next}
FNR==1{n=NR-1}
/rec_cnt=/{$0="rec_cnt=="n}1' file1 file2

Regards

sed 's/rec_cnt=[0-9][0-9]*/rec_cnt='`wc -l file1`'/' file2