ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/ns_dev/Python/NinoCode/RandomCodeRequests/HoneyWell_reqs.txt
(Generate patch)

Comparing Python/NinoCode/RandomCodeRequests/HoneyWell_reqs.txt (file contents):
Revision 475 by nino.borges, Mon Nov 4 17:07:22 2013 UTC vs.
Revision 558 by nino.borges, Fri Jul 25 14:55:19 2014 UTC

# Line 1 | Line 1
1 + === Here I was asked to copy frm long text date to real date field but there were errors because some of the dates were missing info ie. 00/00/1991. I fixed the entries based on their criteria.===
2 + contents = open(r"W:\Manny\Client\honeywell\20140718_ErrorLines_635412948936590376.dat").readlines()
3 + >>> outputFile = open(r"W:\Manny\Client\honeywell\20140718_ErrorLines_FIXED.dat",'w')
4 + >>> for line in contents:
5 + ...     line = line.replace("\n","")
6 + ...     bates,date = line.split("|")
7 + ...     mm,dd,yy = date.split("/")
8 + ...     if mm == '00':
9 + ...             mm = '01'
10 + ...     if dd == '00':
11 + ...             dd = '01'
12 + ...     if yy == '0000':
13 + ...             yy = '1800'
14 + ...     date = '%s/%s/%s'%(mm,dd,yy)
15 + ...     outputFile.write("%s|%s\n"%(bates,date))
16 + ...
17 + >>> outputFile.close()
18 + === END ===
19 + === Here I was asked to make a tally report frm the prefixes in HOBX ===
20 + >>> contents = open(r"W:\Manny\Client\honeywell\PrefixTallyProj\20140717 search for manny_export\20140717 search for manny_export.csv").readlines()
21 + >>> contents = contents[1:]
22 + >>> import FixBatesRange_func
23 + >>> outputFile = open(r"W:\Manny\Client\honeywell\PrefixTallyProj\20140717 search for manny_export\output.txt",'w')
24 + >>> errorFile = open(r"W:\Manny\Client\honeywell\PrefixTallyProj\20140717 search for manny_export\errFile.txt",'w')
25 + >>> matrix = {}
26 + >>> cnt = NinoGenTools.Counter()
27 + >>> for line in contents:
28 + ...     line = line.replace("\n","")
29 + ...     line = line.replace('"',"")
30 + ...     try:
31 + ...             alph = FixBatesRange_func.SeperateAlpha3(line)[0]
32 + ...     except:
33 + ...             alph = "00"
34 + ...             errorFile.write("%s\n"%line)
35 + ...     if alph[:2] == "00":
36 + ...             alph = ""
37 + ...     elif alph[-1] == "0":
38 + ...             while alph[-1] == "0":
39 + ...                     alph = alph[:-1]
40 + ...     if alph in matrix.keys():
41 + ...             matrix[alph] = matrix[alph] + 1
42 + ...     else:
43 + ...             matrix[alph] = 1
44 + ...     cnt.inc()
45 + ...    
46 + >>> outputFile.close()
47 + >>> errorFile.close()
48 + === End ===
49 +
50 + ==== Here I was asked to find documents with family problems.  Note that the values have to be enumerated first.
51 + import FixBatesRange_func
52 + >>> content = open(r"W:\Manny\Client\Perligo\Family_probs_export.csv").readlines()
53 + >>> batesValues = []
54 + >>> attachValues = {}
55 + >>> for line in content:
56 + ...     line = line.replace("\n","")
57 + ...     batesEnum = line.split("|")[6]
58 + ...     batesEnum = batesEnum.split(';')
59 + ...     if batesEnum >1:
60 + ...             for i in batesEnum:
61 + ...                     batesValues.append(i)
62 + ...     else:
63 + ...             batesValues.append(batesEnum)
64 + ...
65 + >>> content = content[1:]
66 + >>> for line in content:
67 + ...     line = line.replace("\n","")
68 + ...     batesBeg = line.split("|")[4]
69 + ...     batesEnd = line.split("|")[5]
70 + ...     batesEnum = FixBatesRange_func.EnumerateBates(batesBeg,batesEnd)
71 + ...     clump = "%s,%s"%(batesBeg,batesEnd)
72 + ...     attachValues[clump] = batesEnum
73 + ...
74 + >>> outputFile = open(r"W:\Manny\Client\Perligo\export_output.txt",'w')
75 + >>> for clump in attachValues.keys():
76 + ...     errList = []
77 + ...     for i in attachValues[clump]:
78 + ...             if i in batesValues:
79 + ...                     pass
80 + ...             else:
81 + ...                     errList.append(i)
82 + ...     if errList:
83 + ...             outputFile.write("%s family is an issue because it's missing pages: "%clump)
84 + ...             for x in errList:
85 + ...                     outputFile.write("%s;"%x)
86 + ...             outputFile.write("\n")
87 + ...            
88 + >>> outputFile.close()
89 + >>> begAttachList = []
90 + >>> contents = open(r"W:\Manny\Client\Perligo\export_output.txt").readlines()
91 + >>> for i in contents:
92 + ...     i = i.split(",")
93 + ...     begAttachList.append(i[0])
94 + ...    
95 + >>> contents = open(r"W:\Manny\Client\Perligo\Family_probs_export.csv").readlines()
96 + >>> outputFile = open(r"W:\Manny\Client\Perligo\overlay.dat",'w')
97 + >>> for line in contents:
98 + ...     line = line.split("|")
99 + ...     if line[4] in begAttachList:
100 + ...             outputFile.write("%s|x\n"%line[0])
101 + ...            
102 + >>> outputFile.close()
103 + >>>
104 +
105 + ==== END =======
106 +
107  
108   ==== Here I was asked to both test the kpmg enumerated values field and to also verify that
109   all of the bendix ranges in rl were in my LFP.
# Line 45 | Line 151 | all of the bendix ranges in rl were in m
151   ...             outputFile.write(line+"\n")
152   ...            
153   >>> outputFile.close()
154 < >>> outputFile2.close()
154 > >>> outputFile2.close()
155 >
156 > ==== END ====

Diff Legend

Removed lines
+ Added lines
< Changed lines (old)
> Changed lines (new)