:a _______ sets the label "a"
$!N ______ as long as it is not the last line, take the next one and add it to be processed
s/\n// ____ substitute all newlines vs nothing ie. delete them
ta _______ as long as this all is true, go back to label "a" and repeat
Not sure on the following ones, someone can explain better maybe:
P _______ print the stuff that has been taken with N
D _______ deletes a part if it has been gathered with N
Maybe you show a part of your input file and add an example of the desired output you want. Use code tags when doing so, ty.