Hi!
I need a script in Powershell or VBS to read a text file (TEST.TXT) and cut off lines that have a pre-defined "date field" older than Actual Date - "N" days. Better: I want keep in file, just the lines with
"date field" of the last "N" Days. A new file can be generated TEST.NEW.
(Obs:
1) format date: dd/mm/yy
2) Lines are in date-order
)
Example: KEEP just the lines with "date field" newer than 10 ten days ago.
Current date = 14/04/08
Day offset = 10
So, keep lines with "date field" newer than 04/04/08 (14/04/08 - 10 days = 04/04/08)
Content of TEST.TXT:
"01/03/08 18:32:32","Any String 1","Other String", "And Another 1"
"02/04/08 18:32:32","Any String 2","Other String", "And Another 2"
"03/04/08 18:32:32","Any String 3","Other String", "And Another 3"
"10/04/08 18:32:32","Any String 4","Other String", "And Another 4"
"14/04/08 18:32:32","Any String 5","Other String", "And Another 5"
Content of resulting file TEST.NEW
"10/04/08 18:32:32","Any String 4","Other String", "And Another 4"
"14/04/08 18:32:32","Any String 5","Other String", "And Another 5"
Best Regards,
Artur
Start Free Trial