Sep-04-2019, 05:35 PM
Hi,
I want to extract particular string in a file.suppose file contains the following string.
INFO 2019-02-19 20:59:56,178 - Process Start time : 2019-02-19 20:55:09.778793
INFO 2019-02-19 20:59:56,178 - Process End time : 2019-02-19 20:59:56.178893
Output should be like as below.
I want to extract particular string in a file.suppose file contains the following string.
INFO 2019-02-19 20:59:56,178 - Process Start time : 2019-02-19 20:55:09.778793
INFO 2019-02-19 20:59:56,178 - Process End time : 2019-02-19 20:59:56.178893
Output should be like as below.
Output:Process Start time : 2019-02-19 20:55:09.778793
Process End time : 2019-02-19 20:59:56.178893
I tried to achieve the output using below but not succeeded.import re re.match("(.*)Process Start time(.*)", line): c= line.split("-")[3] print(c)Could you please help me in advance