This is a simlar request to the one I posted the other day, however it's a bit more challenging.
I have a list of files with their date modified. Is there a way to parse this to always get to the latest two files?
Here is the text file:
Code: Select all
8/1/2018 8:01:00 AM 2,112,338 Rave_Active_Trial_Site_Enrollment_CLIENT.MDSOL.COM_01Aug2018.txt
8/2/2018 8:00:00 AM 2,112,274 Rave_Active_Trial_Site_Enrollment_CLIENT.MDSOL.COM_02Aug2018.txt
8/3/2018 8:00:00 AM 2,112,482 Rave_Active_Trial_Site_Enrollment_CLIENT.MDSOL.COM_03Aug2018.txt
8/4/2018 8:00:00 AM 2,112,356 Rave_Active_Trial_Site_Enrollment_CLIENT.MDSOL.COM_04Aug2018.txt
8/5/2018 8:00:00 AM 2,112,476 Rave_Active_Trial_Site_Enrollment_CLIENT.MDSOL.COM_05Aug2018.txt
8/6/2018 8:01:00 AM 2,112,706 Rave_Active_Trial_Site_Enrollment_CLIENT.MDSOL.COM_06Aug2018.txt
8/7/2018 8:00:00 AM 2,112,136 Rave_Active_Trial_Site_Enrollment_CLIENT.MDSOL.COM_07Aug2018.txt
8/8/2018 8:02:00 AM 2,112,648 Rave_Active_Trial_Site_Enrollment_CLIENT.MDSOL.COM_08Aug2018.txt
8/9/2018 8:01:00 AM 2,113,504 Rave_Active_Trial_Site_Enrollment_CLIENT.MDSOL.COM_09Aug2018.txt
8/10/2018 8:00:00 AM 2,116,162 Rave_Active_Trial_Site_Enrollment_CLIENT.MDSOL.COM_10Aug2018.txt
8/11/2018 8:00:00 AM 2,116,008 Rave_Active_Trial_Site_Enrollment_CLIENT.MDSOL.COM_11Aug2018.txt
8/12/2018 8:01:00 AM 2,115,870 Rave_Active_Trial_Site_Enrollment_CLIENT.MDSOL.COM_12Aug2018.txt
8/13/2018 8:01:00 AM 2,115,766 Rave_Active_Trial_Site_Enrollment_CLIENT.MDSOL.COM_13Aug2018.txt
8/14/2018 8:00:00 AM 2,114,474 Rave_Active_Trial_Site_Enrollment_CLIENT.MDSOL.COM_14Aug2018.txt
8/15/2018 8:01:00 AM 2,114,944 Rave_Active_Trial_Site_Enrollment_CLIENT.MDSOL.COM_15Aug2018.txt
8/16/2018 8:00:00 AM 2,115,530 Rave_Active_Trial_Site_Enrollment_CLIENT.MDSOL.COM_16Aug2018.txt
7/24/2018 8:00:00 AM 2,110,170 Rave_Active_Trial_Site_Enrollment_CLIENT.MDSOL.COM_24Jul2018.txt
7/25/2018 8:00:00 AM 2,110,734 Rave_Active_Trial_Site_Enrollment_CLIENT.MDSOL.COM_25Jul2018.txt
7/26/2018 8:00:00 AM 2,112,100 Rave_Active_Trial_Site_Enrollment_CLIENT.MDSOL.COM_26Jul2018.txt
7/27/2018 8:00:00 AM 2,111,720 Rave_Active_Trial_Site_Enrollment_CLIENT.MDSOL.COM_27Jul2018.txt
7/28/2018 8:01:00 AM 2,111,636 Rave_Active_Trial_Site_Enrollment_CLIENT.MDSOL.COM_28Jul2018.txt
7/29/2018 8:00:00 AM 2,111,598 Rave_Active_Trial_Site_Enrollment_CLIENT.MDSOL.COM_29Jul2018.txt
7/30/2018 8:01:00 AM 2,111,362 Rave_Active_Trial_Site_Enrollment_CLIENT.MDSOL.COM_30Jul2018.txt
7/31/2018 8:01:00 AM 2,112,462 Rave_Active_Trial_Site_Enrollment_CLIENT.MDSOL.COM_31Jul2018.txt
8/1/2018 8:00:00 AM 73,416 Rave_Active_Trial_Site_Enrollment_CLIENT-ravex.mdsol.com_01Aug2018.txt
8/2/2018 8:00:00 AM 73,982 Rave_Active_Trial_Site_Enrollment_CLIENT-ravex.mdsol.com_02Aug2018.txt
8/3/2018 8:00:00 AM 73,986 Rave_Active_Trial_Site_Enrollment_CLIENT-ravex.mdsol.com_03Aug2018.txt
8/4/2018 8:00:00 AM 74,300 Rave_Active_Trial_Site_Enrollment_CLIENT-ravex.mdsol.com_04Aug2018.txt
8/5/2018 8:00:00 AM 74,300 Rave_Active_Trial_Site_Enrollment_CLIENT-ravex.mdsol.com_05Aug2018.txt
8/6/2018 8:00:00 AM 74,286 Rave_Active_Trial_Site_Enrollment_CLIENT-ravex.mdsol.com_06Aug2018.txt
8/7/2018 8:00:00 AM 74,318 Rave_Active_Trial_Site_Enrollment_CLIENT-ravex.mdsol.com_07Aug2018.txt
8/8/2018 8:00:00 AM 74,474 Rave_Active_Trial_Site_Enrollment_CLIENT-ravex.mdsol.com_08Aug2018.txt
8/9/2018 8:00:00 AM 74,786 Rave_Active_Trial_Site_Enrollment_CLIENT-ravex.mdsol.com_09Aug2018.txt
8/10/2018 8:00:00 AM 74,474 Rave_Active_Trial_Site_Enrollment_CLIENT-ravex.mdsol.com_10Aug2018.txt
8/11/2018 8:00:00 AM 74,610 Rave_Active_Trial_Site_Enrollment_CLIENT-ravex.mdsol.com_11Aug2018.txt
8/12/2018 8:00:00 AM 74,610 Rave_Active_Trial_Site_Enrollment_CLIENT-ravex.mdsol.com_12Aug2018.txt
8/13/2018 8:00:00 AM 74,816 Rave_Active_Trial_Site_Enrollment_CLIENT-ravex.mdsol.com_13Aug2018.txt
8/14/2018 8:00:00 AM 74,816 Rave_Active_Trial_Site_Enrollment_CLIENT-ravex.mdsol.com_14Aug2018.txt
8/15/2018 8:00:00 AM 75,236 Rave_Active_Trial_Site_Enrollment_CLIENT-ravex.mdsol.com_15Aug2018.txt
8/16/2018 8:00:00 AM 75,222 Rave_Active_Trial_Site_Enrollment_CLIENT-ravex.mdsol.com_16Aug2018.txt
7/26/2018 8:00:00 AM 72,264 Rave_Active_Trial_Site_Enrollment_CLIENT-ravex.mdsol.com_26Jul2018.txt
7/27/2018 8:00:00 AM 72,530 Rave_Active_Trial_Site_Enrollment_CLIENT-ravex.mdsol.com_27Jul2018.txt
7/28/2018 8:00:00 AM 72,668 Rave_Active_Trial_Site_Enrollment_CLIENT-ravex.mdsol.com_28Jul2018.txt
7/29/2018 8:00:00 AM 72,790 Rave_Active_Trial_Site_Enrollment_CLIENT-ravex.mdsol.com_29Jul2018.txt
7/30/2018 8:00:00 AM 72,426 Rave_Active_Trial_Site_Enrollment_CLIENT-ravex.mdsol.com_30Jul2018.txt
7/31/2018 8:00:00 AM 73,244 Rave_Active_Trial_Site_Enrollment_CLIENT-ravex.mdsol.com_31Jul2018.txt
Thanks!Rave_Active_Trial_Site_Enrollment_CLIENT.MDSOL.COM_16Aug2018.txt
Rave_Active_Trial_Site_Enrollment_CLIENT-ravex.mdsol.com_16Aug2018.txt