Jan-08-2021, 06:54 PM
(This post was last modified: Jan-08-2021, 06:57 PM by Gribouillis.)
There are probably several ways to do this in python. You could simply open the file and process each line, then write it to stdout. Here is one way to process a single line
>>> import datetime as dt >>> day = dt.timedelta(days=1) >>> >>> s = "15,08/01/2020 0000,778,0,82" >>> e = s.split(',', 2) >>> e ['15', '08/01/2020 0000', '778,0,82'] >>> if e[1].endswith('0000'): ... d = dt.datetime.strptime(e[1].split()[0], '%d/%M/%Y') ... e[1] = '{:%d/%M/%Y} 0000'.format(d + day) ... s = ','.join(e) ... >>> s '15,09/01/2020 0000,778,0,82'