ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/ns_dev/Python/NinoCode/Active_prgs/HW_IproExtract.py
Revision: 583
Committed: Thu Mar 26 13:52:55 2015 UTC (11 years ago) by nino.borges
Content type: text/x-python
File size: 2468 byte(s)
Log Message:
update before leaving

File Contents

# Content
1 """
2 HW_IproExtract
3
4 This program will take a list of bates that we already have and compare it to a lfp from an ipro proj.
5 it will export a dat in 200k chunks for those that are in the ipro but you dont already have.
6
7 """
8
9 import os
10
11 def writeValues(theList,fileCount):
12 print "200k threshold reached. writing values..."
13 filePath = r"\\BSTDD967DTW1\Users\eborges\Box Sync\Client\Honeywell\HOBX\Microfilm_Irrl_Export_Proj\Loads"
14 fileName = "load_%s"%fileCount
15 outputFile = open(os.path.join(filePath,fileName),'w')
16 for i in theList:
17 outputFile.write(i+"\n")
18 outputFile.close()
19 fileCount = fileCount+1
20 print "Values written to %s. Done."%fileCount
21 return [], fileCount
22
23
24
25 if __name__=='__main__':
26 iproFilePath = r"\\BSTDD967DTW1\Users\eborges\Box Sync\Client\Honeywell\HOBX\Microfilm_Irrl_Export_Proj\MicroficheLFPexports\37354040_MICROFICHE_REVIEW.lfp"
27 concordanceFilePath = r"\\BSTDD967DTW1\Users\eborges\Box Sync\Client\Honeywell\HOBX\Microfilm_Irrl_Export_Proj\Concordance\batesList.txt"
28 kpmgFilePath = r"\\BSTDD967DTW1\Users\eborges\Box Sync\Client\Honeywell\HOBX\Microfilm_Irrl_Export_Proj\KPMG\kpmgList.txt"
29
30 existingList = []
31 iproList = []
32 toBeDoneList = []
33 docCount = 0
34 fileCount = 0
35
36
37 print"Now creating existing list from Concordance set..."
38 contents = open(concordanceFilePath).readlines()
39 for i in contents:
40 i = i.replace("\n","")
41 existingList.append(i)
42
43 print "Done."
44 print "Now adding KPMG set to exisitng list..."
45 contents = open(kpmgFilePath).readlines()
46 for i in contents:
47 i = i.replace("\n","")
48 existingList.append(i)
49
50 print "Done."
51 print "Now creating Ipro list..."
52 contents = open(iproFilePath).readlines()
53 for line in contents:
54 line = line.split(",")
55 bates = line[1]
56 docQl = line[2]
57 if line[2] == "D":
58 iproList.append(bates.upper())
59 print "Done."
60 print "There are %s existing files and %s files in ipro."%(len(existingList),len(iproList))
61 print "Now gathering diff..."
62 for x in iproList:
63 if x in existingList:
64 pass
65 else:
66 toBeDoneList.append(x)
67 docCount = docCount+1
68 if docCount >200000:
69 toBeDoneList,fileCount = writeValues(toBeDoneList,fileCount)
70 docCount = 0