Very nice methods using $/. However, with real data I can imagine Chris' being less efficient than my own method (slower compilation time) who uses 2 chunk wide regular expressions while sorting. Other things to note are the O/P probably wants to retain empty lines, Bill's code won't necessarily retain the original order if 2 graph names are the same since it will become controlled by "stuff". Also Bill's output won't be formatted properly in his current code. Just to nitpick beyond the example data!