ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/ns_dev/Python/NinoCode/Active_prgs/Evidox/IncomingProdOverlayCreator.py
Revision: 705
Committed: Tue Jul 14 19:00:09 2020 UTC (5 years, 8 months ago) by nino.borges
Content type: text/x-python
File size: 1850 byte(s)
Log Message:
A simple program, mostly for Eclipse, that will take an incoming prod DAT file and make an overlay file with things like the prodBeg number, Volume, Evidox Media ID, etc.
For now the load file needs to be asci.

File Contents

# User Rev Content
1 nino.borges 705 """
2    
3     IncomingProdOverlayCreator
4    
5     Created by
6     Emanuel Borges
7     2020.07.08
8    
9     A simple program, mostly for Eclipse, that will take an incoming prod DAT file and make an overlay file with things like the prodBeg number, Volume, Evidox Media ID, etc.
10     For now the load file needs to be asci.
11    
12    
13     """
14    
15     import os
16    
17     if __name__ == '__main__':
18     pathToDat = r"\\Xiprofsrvw01\xiprofsrvw01\Databases\PollackSD\PSDU-Elwell-Raymond James\Ipro Review\PSDU-Elwell-RaymondJames\Production-Incoming\PIM001\PIM001.dat"
19     pathToOutputFile = r"\\Xiprofsrvw01\xiprofsrvw01\Databases\PollackSD\PSDU-Elwell-Raymond James\Ipro Review\PSDU-Elwell-RaymondJames\Production-Incoming\PIM001\PIM001_XDD_OVERLAY.dat"
20     pathToCrossRefFile = r"\\Xiprofsrvw01\xiprofsrvw01\Databases\PollackSD\PSDU-Elwell-Raymond James\Ipro Review\PSDU-Elwell-RaymondJames\Production-Incoming\PIM001\PIM001_XDD_XREF.dat"
21    
22     docIDFieldNumber = 0
23     endDocFieldNumber = 1
24     prodVolume = "PIM001"
25     evMediaID = "102493"
26    
27     delim = "\x14"
28     quoteChar = "\xfe"
29    
30     outputFile = open(pathToOutputFile,'w')
31     outputFile.write("EVDXID"+ delim + "ProdBegBates"+ delim + "ProdEndBates" + delim + "ProdVolume"+ delim + "EvidoxMediaID"+"\n")
32     xrefFile = open(pathToCrossRefFile,'w')
33     xrefFile.write("EVDXID"+ delim + "ProdBegBates"+"\n")
34     contents = open(pathToDat).readlines()
35     contents = contents[1:]
36    
37     for line in contents:
38     line = line.replace("\n","")
39     line = line.replace(quoteChar,"")
40     line = line.split(delim)
41     outputFile.write(line[docIDFieldNumber] + delim + line[docIDFieldNumber] + delim + line[endDocFieldNumber] + delim + prodVolume + delim + evMediaID + "\n")
42     xrefFile.write(line[docIDFieldNumber] + delim + line[docIDFieldNumber] + "\n")
43     outputFile.close()
44     xrefFile.close()
45