I have a file containing records which have a date in the form MM/DD/YYYY at the beginning of each record. Since this file grows by the appending of current transactions every day, it's going to be huge in short order. I'd like to go in and prune anything older than 30 days based on this date value as part of my daily processing script. I've looked at 'man date' without success and done a search here and in my reference books (all 3 of them) ... again, no luck.
I had thought I could convert the 'pivot' date - 30 days ago - to seconds (I have a .ksh script to do that) and then search the file, converting each record's date to seconds (that's problem #1, I don't know how to do that in Perl) and compare the two. All records with a converted value less than the pivot date value would not be written to the new file.
Any thoughts/comments/suggestions/one-way trips to Kauai would be most appreciated!
Tnx in advance.
Tom
"My mind is like a steel whatchamacallit ...
I had thought I could convert the 'pivot' date - 30 days ago - to seconds (I have a .ksh script to do that) and then search the file, converting each record's date to seconds (that's problem #1, I don't know how to do that in Perl) and compare the two. All records with a converted value less than the pivot date value would not be written to the new file.
Any thoughts/comments/suggestions/one-way trips to Kauai would be most appreciated!
Tnx in advance.
Tom
"My mind is like a steel whatchamacallit ...