If I understand it correctly,
the hard part is converting a paragraph into a string and back again.
Here is a suggestion:
To each sequence of vertical strokes add one more.
Change each newline into a vertical stroke.
Sort the strings.
Change them back into paragraphs.
Not sure how to do any of that with awk.
I'd use python.
--
Michael hennebry(a)web.cs.ndsu.NoDak.edu
"SCSI is NOT magic. There are *fundamental technical
reasons* why it is necessary to sacrifice a young
goat to your SCSI chain now and then." -- John Woods