Find and replace multiple lines

I have a section of text in file A, see below

# falkdjf lkjadf lkjadf
lkajdf lkajdf lkajdf lkjadf
lkjadf 234.234.2.234
lkjlkjlk 234.234.3.234
#

Only the first line with "# falkdjf lkjadf lkjadf" is unique in the file. The new section that I want to overwrite the old section above is in file B. The new section may have one less line or one extra line.

How do I do that? I have very little scripting and unix background.

I telnet on my xp machine to a linux system. Thanks!

Try this:

awk 'f && /#/{f=0;next}/# falkdjf lkjadf lkjadf/{system("cat fileB");f=1}!f' fileA > fileNew