ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/ns_dev/Python/NinoCode/Active_prgs/Concordance/InfoOnlyFieldCreator.py
Revision: 367
Committed: Wed May 29 17:49:14 2013 UTC (12 years, 10 months ago) by nino.borges
Content type: text/x-python
File size: 3289 byte(s)
Log Message:
save

File Contents

# User Rev Content
1 ninoborges 8 """
2    
3     InfoOnlyFieldCreator
4    
5     Created by
6     Emanuel Borges
7     06.16.2009
8    
9     This program will assist in the creation of the Info-Only fields in Ipro by taking a text file of BegNo,EndNo,
10     inumerating the pages, and then give you an importable LFP with
11     IO, (bates page), <Info Only field>,<what you want on the stamp>
12    
13     You will then import this, making the info only fields in Ipro first.
14    
15     """
16    
17    
18     import FixBatesRange_func
19    
20     def CreateInfoOnlyFile(pathToFile, pathToOutputFile, infoOnlyField, stampValue):
21     contents = open(pathToFile).readlines()
22     outputFile = open(pathToOutputFile,'w')
23     for line in contents:
24     line = line.replace("\n","")
25     begNo, endNo = line.split(",")
26 nino.borges 367 if len(begNo) == len(endNo):
27     batesList = FixBatesRange_func.EnumerateBates(begNo, endNo)
28     else:
29     begNoAlpha = begNo
30     begNo = begNo + "_0001"
31     tempList = FixBatesRange_func.EnumerateBates(begNo.split('_')[1],endNo.split('_')[1])
32     batesList = []
33     for i in tempList:
34     batesList.append(begNoAlpha + "_" + i)
35    
36 ninoborges 8 for bates in batesList:
37     outputFile.write("IO,%s,%s,%s\n"%(bates, infoOnlyField, stampValue))
38     outputFile.close()
39    
40    
41     if __name__ == '__main__':
42 nino.borges 367 pathToFile = r'C:\Test_dir\Davita\DNV EML_REVIEW3_2.DAT'
43     pathToOutputFile = r'C:\Test_dir\Davita\DNV EML_REVIEW3_2.lfp'
44 ninoborges 8
45     infoOnlyField = '1'
46     #stampValue = "HIGHLY CONFIDENTIAL - Attorney's Eyes Only"
47    
48     #pathToFile = r'\\lisdisdss01\DIS19\c_d\39667116\Prod\Mdrummone_CONF.DAT'
49     #pathToOutputFile = r'\\lisdisdss01\DIS19\c_d\39667116\Prod\Mdrummone_CONF.lfp'
50    
51     #infoOnlyField = '2'
52     #stampValue = "CONFIDENTIAL BUSINESS INFORMATION - SUBJECT TO PROTECTIVE ORDER"
53    
54 nino.borges 367 stampValue = "PRODUCED TO GOVT PER COURT ORDER ON 05/10/2013"
55 ninoborges 8 CreateInfoOnlyFile(pathToFile, pathToOutputFile, infoOnlyField, stampValue)
56    
57    
58    
59     ## This is a special chunk that shows you how to do this on a database like tria, where ther are foo-0001.001 - foo-0001.092 bates
60    
61     ## for conf
62     ##contents = open(r"\\lisdisdss01\dis23\c_d\82185012\Prod\conf2.dat").readlines()
63     ##>>> outputFile = open(r"\\lisdisdss01\dis23\c_d\82185012\Prod\conf2.lfp",'w')
64     ##>>> for line in contents:
65     ##... line = line.replace("\n","")
66     ##... begNo,EndNo = line.split(",")
67     ##... alpha, beg = begNo.split(".")
68     ##... nul, end = EndNo.split(".")
69     ##... batesList = FixBatesRange_func.EnumerateBates(beg,end)
70     ##... for i in batesList:
71     ##... outputFile.write("IO,"+alpha + "."+i + ",2,CONFIDENTIAL BUSINESS INFORMATION - SUBJECT TO PROTECTIVE ORDER"+"\n")
72     ##...
73     ##>>> outputFile.close()
74    
75     ## for hconf
76     ##>>> contents = open(r"\\lisdisdss01\dis23\c_d\82185012\Prod\hconf2.dat").readlines()
77     ##>>> outputFile = open(r"\\lisdisdss01\dis23\c_d\82185012\Prod\hconf2.lfp",'w')
78     ##>>> for line in contents:
79     ##... line = line.replace("\n","")
80     ##... begNo,EndNo = line.split(",")
81     ##... alpha, beg = begNo.split(".")
82     ##... nul, end = EndNo.split(".")
83     ##... batesList = FixBatesRange_func.EnumerateBates(beg,end)
84     ##... for i in batesList:
85     ##... outputFile.write("IO,"+alpha + "."+i + ",1,HIGHLY CONFIDENTIAL - Attorney's Eyes Only"+"\n")
86     ##...
87     ##>>> outputFile.close()
88