Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- months_map = {'Jan': '01', 'Feb': '02', 'Mar': '03', 'Apr': '04', 'May': '05', 'Jun': '06', 'Jul': '07', 'Aug': '08', 'Sep': '09', 'Oct': '10', 'Nov': '11', 'Dec': '12',}
- for line in open("C:/users/jacob/desktop/python/input.txt").readlines():
- if "-" in line: print(line.replace('\n', ""))
- if "#" in line:
- if int(line[3:5]) >= 51: theYear = 1900 + int(line[3:5])
- else: theYear = 2000 + int(line[3:5])
- print((str(theYear) + "-" + line[:2] + "-" + line[6:10]).replace('\n', ""))
- if "/" in line:
- if int(line[6:]) >= 51: theYear = 1900 + int(line[6:])
- else: theYear = 2000 + int(line[6:])
- print(str(theYear) + "-" + line[:2] + "-" + line[3:5])
- if "*" in line: print(line[6:10] + "-" + line[3:5] + "-" + line[:2])
- if "," in line:
- if int(line[7:12]) <= 50: theYear = 2000 + int(line[7:12])
- elif 50 < theYear <100: theYear = 1900 + int(line[7:12])
- print((str(theYear) + "-" + months_map[line[0:3]] + "-" + line[4:6]))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement