The following will work on non-GNU sed
(the ,+1
address syntax is a GNU extension):
sed -e '/^a1$/,/^/d' my_file >my_filtered_file
"Starting at a line that reads exactly 'a1', and ending at the next line for which the beginning of the line exists (i.e. the next line), delete."
It's much less extensible than @asoundmove's answer, though, as deleting a different number of lines would take an entirely different script.