in reply to Format lines in a File to be outputted in a different sequence
Welcome to PerlMonks, markgoz.
It would be helpful if you'd enclose the 'before' and 'after' datasets within <code> tags, so the wanted formatting is apparent.