How to sort the folder to latest date in a package present inside directory.
For Eg:
The package name is wf011213
here,wf is package name,01 is month,12 is date and 13 is year,
Like this there are list of folder names,Need to pick the latest folder from the list.
Parse the filename to extract the date and reorder the numbers to yymmdd format then compare that number with the previous parsed filename keeping the one that is greater.
I assume the folder contains an assortment of packages and you want the latest/newest of each. You'll want to maintain a hash where the keys are the package names (e.g., wf in this case) and the value will be the largest datestamp found for that package.