I have a file in which each line contains one timestamp as a part of that line. The timestamp format is 1996-07-04 00:00:00.0 . I want to convert this to 1996-07-04 00:00:00 without the millisecond in each line. I tried using re.sub() method in Python but it replaces it with the value given by me and does not retain the original timestamp.
I was using
re.sub("(\d\d\d\d-\d\d-\d\d\s+\d\d:\d\d:\d\d.\d)", "replace without millisec", cell)
The 2nd parameter is my problem.
[:-2]?