| 1 |
nino.borges |
651 |
#### Epic Genetics where I was asked to calculate the day of the week for documents with a date sent value
|
| 2 |
|
|
|
| 3 |
|
|
import datetime
|
| 4 |
|
|
contents = open(r"T:\Hirsch Roberts Weinstein\Epic Genetics-Rodrigues\3189824\RawDates.dat").readlines()
|
| 5 |
|
|
outputfile = open(r"T:\Hirsch Roberts Weinstein\Epic Genetics-Rodrigues\3189824\outputDates.dat",'w')
|
| 6 |
|
|
|
| 7 |
|
|
contents = contents[1:]
|
| 8 |
|
|
|
| 9 |
|
|
for line in contents:
|
| 10 |
|
|
... line = line.replace("\n","")
|
| 11 |
|
|
... line = line.replace(quote,"")
|
| 12 |
|
|
... line = line.split(delim)
|
| 13 |
|
|
... bates = line[0]
|
| 14 |
|
|
... rawDate = line[1]
|
| 15 |
|
|
... parsedDate = datetime.datetime.strptime(rawDate, "%m-%d-%Y")
|
| 16 |
|
|
... dayOfWeek = datetime.datetime.strftime(parsedDate, "%A")
|
| 17 |
|
|
... outputfile.write("%s|%s\n"% (bates, dayOfWeek))
|
| 18 |
|
|
|
| 19 |
|
|
|
| 20 |
|
|
outputfile.close()
|
| 21 |
|
|
|
| 22 |
|
|
|
| 23 |
|
|
|
| 24 |
|
|
|
| 25 |
|
|
|