I am trying to put together a script that will search a txt file for a timestamp and select all text after the initial one up to EOF but the timestamp searched for will depend on the current date
So if it the current time is between 0600 and 0700 the script will search a text file (currently open) for a timestamp in the form of YY/MM/DD(yesterdays date)HH:MM that is AFTER 1900 and up to the current date and time. If it finds a stamp within that window it should select all text from that stamp to EOF.
The other case is, if the current time is between 1800 and 2000 then the script should search for a timestamp in the same format but on today's date.
Then if it finds one it should select all text from that timestamp up and to EOF
Something like:
If ( 06:00>Now()<=07:00
then (search for YY/MM/DD HH:MM > YY/MM/DD(-1) 19:00)
if (search finds match)
select all up to EOF
else exit
else ( search for YY/MM/DD HH:MM > YY?MM/DD 07:00)
if (search finds match)
select all to EOF
Sorry for the above but it is (for me ) the easiest way to explain my needs!
After the selection is made I think I know how to print it to a new file but not 100% sure.
For now if I can make the required selection based on the terms I would be more than happy.
Any help would be appreciated greatly!
That has some very helpful info but one thing,
How to I search so that it will look for the date and time AFTER a given DATE + TIME?
So the timestamp could be anywhere from yesterday @ 1900 up to now (between 0600 and 0700) so when it finds it it should select all text in file after.
I have attached the file I want to pull the text from...
So this would be run between 06:00 and 07:00 and from the file I want anything done after 19:00 the previous day.
So the first set of action up to the action started at 01:33 "this morning" should not be pulled, just the actions timestamped after 19:00 yesterday,
Thanks!