I have a script which gets all the files from particular location.But I need to fetch the files which are lates. The script should give the latest files which are present at that location.
eg.I have a location at whcih there are some files named as below
DataLogs_20141125_AP.CSV
DataLogs_20141125_UK_EARLY.CSV
DataLogs_20141125_CAN.CSV
DataLogs_20141125_US.CSV
DataLogs_20141125_EUR.CSV
DataLogs_20141125_US_2.CSV
DataLogs_20141126_AP.CSV
DataLogs_20141126_UK_EARLY.CSV
DataLogs_20141126_CAN.CSV
DataLogs_20141126_US.CSV
DataLogs_20141126_EUR.CSV
DataLogs_20141126_US_2.CSV
I want to fetch the files which are the latest. eg.the files matching "20141126" pattern are the latest ones.
I tried with match but it gives me all the files.
filematch ='DataLogs_2014_*.CSV'