Sorting the Dates from recently used
How to sort the folder to latest date in a package present inside directory.
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.
How shall i do it.Please give an idea.
Thanks in advance,
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.
|All times are GMT +1. The time now is 12:10 PM.|
Powered by vBulletin®
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.