Here is the list of item in my array: If you see there are files generated with the dates on them (e.g., update.20130410.xml). I should be taking only the latest file and remove the rest. Let's assume that the array values are sorted, so it should be fine if we are just picking the top item among the repeating pattern. Please help me.
Original array:
theOneBig.xml
theSecondFine.xml
theTestOne.xml
OtherImp.xml
mrss.xml
update.20130410.xml
update.20130402.xml
update.20120314.xml
update.20120313.xml
update.20120312.xml
update.20120301.xml
update.20130411.xml
file.update.20130410.xml
file.update.20130409.xml
file.update.20130409.xml
Output I would like to get is
theOneBig.xml
theSecondFine.xml
theTestOne.xml
OtherImp.xml
mrss.xml
update.20130410.xml
file.update.20130410.xml