w = ('Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday',
    'Sunday')
l = linecache.getline('Aberdeen2005.txt', 5)
m = [(d in l) for d in w]
c = '2005', '2016'
if any(y in l for y in c):
    if any(x in l for x in w):
        r = [i for i, v in enumerate(m, 0) if v]
l = l.replace(' ' + w[r[0]], '')
with open('dates.txt', 'a') as article_dates:
    article_dates.write(l)
linecache.clearcache()
Список дат в тексте