Some hints how I would solve this:
In reply to Re: sort timestamps with associated names. by hdb in thread sort timestamps with associated names. by Sparky