HEADER
1111AAAA
3333CCCC
2222BBBB
TRAILER
1111AAAA
3333CCCC
2222BBBB
TRAILER
I want to sort this input file excluding the HEADER and TRAILER but the HEADER and TRAILER should be in the output of the sorted file.
i.e this should be the output
HEADER
1111AAAA
2222BBBB
3333CCCC
TRAILER
1111AAAA
2222BBBB
3333CCCC
TRAILER
Is there a way to do it?