I am having a file as stated below :
File 1:
##########################
idnd a
integer 2;
list 1 ;
list2 ;
chip top alist( .a(1) , .b(2) , .c(3) ,
.d(1) , .e(7) , .n(80),
.d(1) , .g(7) , .n(80),
.f(1) , .e(7) , .m(80));
lis 7 nfj ;
jdjd kn;
jsjd l ;
######################################
I am having another file as stated below
File2
########################3
int y ;
lsi 8
lis kf l
kd d ;
jdjd l;
dkdk ;
###########################
I want to insert the content of File 2 to File 1 after a pattern match
Pattern to match
chip_top alist till ));
After )); it should insert FILE2 into FILE 1 and create another FILE3
as stated below
FILE 3
#################################
idnd a
integer 2;
list 1 ;
list2 ;
chip top alist( .a(1) , .b(2) , .c(3) ,
.d(1) , .e(7) , .n(80),
.d(1) , .g(7) , .n(80),
.f(1) , .e(7) , .m(80));
// file 2 content //
int y ;
lsi 8
lis kf l
kd d ;
jdjd l;
dkdk ;
lis 7 nfj ;
jdjd kn;
jsjd l ;
######################################
I was trying something like this but its not working
sed '/chip_top alist,/));/r FILE2' FILE1 > FILE3
Could you help me out ??