Have several text files and want to merge into a single

Hello,

I have several files that begin with db. in my directory and I would like to first take it from a specific word starting from $TTL until the end of the contents then do the same all the way down the directory then merge them into one txt file.

Is this possible? I am using cygwin with perl installed and a slew of other add-ons

Thanks

start with this -

for filename in db*
do
      sed -n '/\$TTL/,$p'  $filename
done  > newfile

Or maybe this:

 awk ' FNR == 1 {flag = 0} /\$TTL/ {flag = 1} flag' db* > newFile

Awesome !

Thanks

HI, a real quick question, how about same senerio but all contents after 17 lines down

Thanks