I'm searching for an elegant way to replace a block of lines in ASCII-file1 with all lines of file2 beginning with the 2nd line. The lines to be replaced in file1 are encapsulated within blank line nr.2 and nr.3 .
The numbers of the first and the last line of the block in file1 are fix for a bunch of files, but a more general solution would be desirable.
file1:
first
text
block
#blank line
second textblock
#blank line
third
text
block
#blank line
file2:
first line
all
the
other
lines
expected file1 after replacement:
first
text
block
#blank line
second textblock
#blank line
all
the
other
lines
#blank line