add txt

=300 same text
=541 same text
=952 p000298
=952 p000299
=050 same text1
=082 same text1
=952 p002930
=952 p002931

Possible to add every sequence of =952%. add last sequence =LDR 00000nam
out put

=300 same text
=541 same text
=952 p000298
=952 p000299
=LDR 00000nam
=050 same text1
=082 same text1
=952 p002930
=952 p002931
=LDR 00000nam

awk '{if(/^=952/){if(!t){t=1}}else if(t){print "=LDR 00000nam"; t=""}} 1; END{if(t)print "=LDR 00000nam"}' infile

Try this

awk '!/=952/{if(f==1){x="=LDR 00000nam";f=0;print x}}/=952/{f=1}1;END{if(f==1){print x}}' file

regards,
Ahamed

thanks