How to delete more lines

Hi experts !

I need to delete two range of lines in this command. Is that possible ?

ie. line 1 - 22 and 36 to 40. How do i do this in one go ??

ls -1t ${RESULT}/*.trc | while read TRACE_FILE
do
grep CONTROLFILE ${TRACE_FILE}
rc=$?
if [[ $rc -eq 0 ]]
then
sed -e '
1,22d
s/'${ORACLE_SID}'/'${TARGET}'/g
/\# Recovery/,/ARCHIVE LOG ALL;/d
s/REUSE DATABASE/SET DATABASE/
s/NORESETLOGS ARCHIVELOG/RESETLOGS NOARCHIVELOG/
s/ALTER DATABASE OPEN/ALTER DATABASE OPEN RESETLOGS/
' ${TRACE_FILE} > ${OUT_CTL}
break
fi
done

Thanks in advance

Specify two delete expressions to sed.

sed -e '1,22 d' -e '36,40 d' tmpfile

Cheers,
ZB