in reply to How to sort data in the input file ?

One problem may be that your data is INconsistent. Note the doubled "&" in 3 after the date.

More generally, this looks like a case where you might profitably use a different regex to capture the just the date (eg  m%\d&(\d{8})&% ) and a hash, keyed on the date, with the full string as a value. Once you have it in the proposed hash, sorting comes easy...