ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/ns_dev/Python/NinoCode/RandomCodeRequests/Evidox-Epic.txt
Revision: 651
Committed: Thu Dec 12 20:45:58 2019 UTC (6 years, 3 months ago) by nino.borges
Content type: text/plain
File size: 755 byte(s)
Log Message:
small updates

File Contents

# Content
1 #### 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