I have some data sets (foo) with bar and baz as output in sections'. Sections with baz should be sorted to be at the top of the output.
Example input;
= foo4 =
bar
(..)
barN
= foo1 =
bar
(..)
barN
= foo5 =
bar
(..)
barN
baz
= foo2 =
bar
(..)
barN
= foo3 =
bar
(..)
barN
baz
In above example, I would like section = foo3 = and = foo5 = to be moved to the top of the output, and have the list sub-sorted by section "name", ie.
= foo3 =
= foo5 =
= foo1 =
= foo2 =
= foo4 =
but with the contents of the section intact.