Edit text file based on current time

Hi,
I have a text file which contain the time and some text in the sequence.
e.g. 4:00 ijk , 5:30 abc , 6:00 zyz , 7:00 pqr , 9:30 def

Now I want to remove the text if the current time is 5:30 and the the file will be
5:30 abc , 6:00 zyz , 7:00 pqr , 9:30 def

Then at 6:00 is should be
6:00 zyz , 7:00 pqr , 9:30 def

and so on. Is there any solution for this scenario?

You can use substring and index of to locate the current time to remove everything before
i.e. String.Substring(String.IndexOf(“5:30”))

@Atul_Rai

Read text file
Use
String.Substring(string.indexOf(now.tostring("“h:mm”)))

thanks @rahatadi

@Atul_Rai

welcome :slight_smile: