Updated Script. Can handle pattern in file.
And date in file.