Mar-04-2024, 09:07 PM
Greetings!
I’d like to match strings in files, it seems simple but I’m failing to do this…
It has multiple white spaces before the word Start Time or End Time and the Time and Date of the event
Then I tried:
I was sure by using “\s+” would filter the line I wanted but it does not.
Would you help me with this?
Thank you.
I’d like to match strings in files, it seems simple but I’m failing to do this…
It has multiple white spaces before the word Start Time or End Time and the Time and Date of the event
String “ Start Time 2/28/2024 8:34:34 AM ”I tried :
if re.search("\s+\Start\s\Time",el) : # < ------------- el is a line from the file ,,, print(f" START LN {el}")And got an error message “ bad escape \T at position 11”
Then I tried:
if re.search("\s+\Start\s\",el) : # < ------------- el is a line from the file ,,, print(f" START LN {el}")This one prints tons of other lines I do not care about.

I was sure by using “\s+” would filter the line I wanted but it does not.
Would you help me with this?
Thank you.