| 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.
|
| 110 |
-------------------------------
|
| 111 |
>>> contents = open(r"\\bstads01\app\Manny\Client\honeywell\LFP Export\LFP Export\Non_microfiche\373540873_REVIEW_JUSTBENDIX.lfp").readlines()
|
| 112 |
>>> MasterList = []
|
| 113 |
>>> for line in contents:
|
| 114 |
... bates = line.split(",")[1]
|
| 115 |
... MasterList.append(bates)
|
| 116 |
...
|
| 117 |
>>> len(MasterList)
|
| 118 |
357525
|
| 119 |
|
| 120 |
-------------------------------
|
| 121 |
>>> outputFile2 = open(r"C:\Client\honeywell\BENDIX-Beg_End_Enum_enumErr.csv",'w')
|
| 122 |
>>> outputFile = open(r"C:\Client\honeywell\BENDIX-Beg_End_Enum_output.csv",'w')
|
| 123 |
>>> for line in contents:
|
| 124 |
... line = line.replace("\n","")
|
| 125 |
... begNo,endNo,enumValues = line.split(",")
|
| 126 |
... begTest = begNo.split(" ")[-1]
|
| 127 |
... endTest = endNo.split(" ")[-1]
|
| 128 |
... rangeTest = FixBatesRange_func.EnumerateBates(begTest,endTest)
|
| 129 |
... enumCount = len(rangeTest)
|
| 130 |
... if ";" in enumValues:
|
| 131 |
... kpmgEnumCount = len(enumValues.split(";"))
|
| 132 |
... else:
|
| 133 |
... kpmgEnumCount = 1
|
| 134 |
... if enumCount == kpmgEnumCount:
|
| 135 |
... pass
|
| 136 |
... else:
|
| 137 |
... outputFile2.write(line+"\n")
|
| 138 |
... if begNo in MasterList:
|
| 139 |
... pass
|
| 140 |
... elif begNo.replace(" "," ") in MasterList:
|
| 141 |
... pass
|
| 142 |
... elif begNo.replace(" "," ") in MasterList:
|
| 143 |
... pass
|
| 144 |
... elif begNo.replace(" "," ") in MasterList:
|
| 145 |
... pass
|
| 146 |
... elif begNo.replace(" ","") in MasterList:
|
| 147 |
... pass
|
| 148 |
... elif begNo.replace(" ","") in MasterList:
|
| 149 |
... pass
|
| 150 |
... else:
|
| 151 |
... outputFile.write(line+"\n")
|
| 152 |
...
|
| 153 |
>>> outputFile.close()
|
| 154 |
>>> outputFile2.close()
|
| 155 |
|
| 156 |
==== END ==== |