i have a requirement to delete records that do not belong to that day. For example in a file that came on July 31st ,2018 there are records that belong to Aug 1st,2018 as well and I want to find and delete those records. I want to delete anything with 01-Aug-2018 . I have several files like that. I need a script that gets the first line second column that is date and add one day to it and delete that record.in this case all 1st Aug records should be deleted. Thank you in advance for your help.
a,31-Jul-2018 12:00,14
a,31-Jul-2018 12:01,13
a,31-Jul-2018 12:02,15
a,31-Jul-2018 12:03,19
and so on
.
.
a,31-Jul-2018 11:59,6
a,01-Aug-2018 12:00,9
b,31-Jul-2018 12:00,7
b,31-Jul-2018 12:01,7
b,31-Jul-2018 12:02,6
b,31-Jul-2018 12:03,3
and so on
.
.
b,31-Jul-2018 11:59,8
b,01-Aug-2018 12:00,9
c,31-Jul-2018 12:00,7
c,31-Jul-2018 12:01,7
c,31-Jul-2018 12:02,6
c,31-Jul-2018 12:03,8
Thank you for looking into this. There will not be records that are less than the date you see in the first row. july 1st file will have july first records and few records with july 2 and i want to delete those july 2 second records. I just tried awk by googling
awk -F ',' '{print $3}' file1.txt
that gets the first date and i dont know how to add one day to it and delete those records correspoding to it.