[Solved] Print specific lines after a text present in another text file


while read str; do sed -n "/^$str/,/^C/ {/^$str/p;/^D/p}" Text-file-2; done < Text-file-1

This is the sed command, contributed by steeldriver on another forum. And its working fine.

solved Print specific lines after a text present in another text file