Hi,
I have a text file with lots of text and dates in the format dd/mm/yyyy, with years ranging from 1970 to 2022. I want to read this file and convert the dates to yyyy-mm-dd format, while keeping all the text as it is. Do you know how to do it with Python? Or I don't mind using another tool (such as awk, sed) but as long as the rest of the file will not be affected.
Optionally, I want to search also for dates without leading zeros in day or month, and convert them too. But first I want to display them (I'm not sure if there are such dates).
It's important not to convert other strings, so if the "year" is not from 1970 to 2022, don't convert the string.