Yes, you're absolutely right, sundialsvc4, this can be done section by section (read one section, sort it, print it out, then proceed to the next section, etc.), and this is actually what I would most probably do in such a case, especially if the input file is large.
Comment on Re^3: Use Perl's Sort to only sort certain lines in a file?