ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/ns_dev/Python/NinoCode/Active_prgs/Summation/Summation_functions/DirToDat.py
Revision: 8
Committed: Sat May 5 04:21:19 2012 UTC (13 years, 10 months ago) by ninoborges
Content type: text/x-python
File size: 872 byte(s)
Log Message:
Initial Import

File Contents

# User Rev Content
1 ninoborges 8 """
2    
3     DirToDat
4    
5     This program will take a dii created by DirToDii and export a comma separated DAT file.
6    
7     Created by
8     Emanuel Borges
9     10.27.2007
10    
11     """
12    
13     if __name__ == '__main__':
14     fileName = "6th_Prod_05-21-2007"
15     contents = open(r"\\ercdis12\k\C_D\30790270\20071101\6th_Prod_05-21-2007\%s.DII"% fileName).readlines()
16     outputFile = open(r"c:\test_dir\DELPHI\%s.DAT"% fileName,'w')
17     endDoc = ""
18     pageCount = ""
19     for line in contents:
20     if line[:10] == "@C EndDoc#":
21     endDoc = line.split("EndDoc# ")[1]
22     elif line[:10] == "@C Pgcount":
23     pageCount = line.split("@C Pgcount ")[1]
24     elif line[:2] == "@T":
25     bates = line.split("@T ")[1]
26     outputFile.write(bates.strip("\n") + "," +endDoc.strip("\n") + "," +pageCount.strip("\n") + "," + fileName +"\n")
27     outputFile.close()