| 1 |
"""HTC enumerations"""
|
| 2 |
contents = open(r"C:\Documents and Settings\eborges\Desktop\Working\HTC Productions.txt").readlines()
|
| 3 |
>>> for line in contents:
|
| 4 |
... line = line.replace("\n","")
|
| 5 |
... beg,end = line.split("|")
|
| 6 |
... batesRange = FixBatesRange_func.EnumerateBates(beg, end)
|
| 7 |
... outputFile.write(beg + "|"+end+"|")
|
| 8 |
... for i in batesRange:
|
| 9 |
... outputFile.write(i + ";")
|
| 10 |
... outputFile.write("\n")
|
| 11 |
>>> outputFile = open(r"C:\Documents and Settings\eborges\Desktop\Working\HTC Productions_enum.txt",'w')
|
| 12 |
>>> for line in contents:
|
| 13 |
... line = line.replace("\n","")
|
| 14 |
... beg,end = line.split("|")
|
| 15 |
... batesRange = FixBatesRange_func.EnumerateBates(beg, end)
|
| 16 |
... outputFile.write(beg + "|"+end+"|")
|
| 17 |
... for i in batesRange:
|
| 18 |
... outputFile.write(i + ";")
|
| 19 |
... outputFile.write("\n")
|
| 20 |
>>> for line in contents:
|
| 21 |
... line = line.replace("\n","")
|
| 22 |
... beg,end = line.split("|")
|
| 23 |
... if beg:
|
| 24 |
... batesRange = FixBatesRange_func.EnumerateBates(beg, end)
|
| 25 |
... outputFile.write(beg + "|"+end+"|")
|
| 26 |
... for i in batesRange:
|
| 27 |
... outputFile.write(i + ";")
|
| 28 |
... outputFile.write("\n")
|
| 29 |
>>> outputFile.write("PRODBEG" + "|"+"PRODEND"+"|"+"PROD_Enumerated\n")
|
| 30 |
>>> for line in contents:
|
| 31 |
... line = line.replace("\n","")
|
| 32 |
... beg,end = line.split("|")
|
| 33 |
... if beg:
|
| 34 |
... batesRange = FixBatesRange_func.EnumerateBates(beg, end)
|
| 35 |
... outputFile.write(beg + "|"+end+"|")
|
| 36 |
... for i in batesRange:
|
| 37 |
... outputFile.write(i + ";")
|
| 38 |
... outputFile.write("\n")
|
| 39 |
...
|
| 40 |
>>> outputFile.close()
|
| 41 |
|
| 42 |
"""This one actually works better, since sam gave me a file where sometimes it does have a begno and others it does not."""
|
| 43 |
outputFile = open(r"C:\Documents and Settings\eborges\Desktop\Working\HTC Productions_enum_NEW.txt",'w')
|
| 44 |
>>> outputFile.write("CTRL"+"|"+"PRODBEG" + "|"+"PRODEND"+"|"+"PROD_Enumerated\n")
|
| 45 |
>>> for line in contents:
|
| 46 |
... line = line.replace("\n","")
|
| 47 |
... ctrl,beg,end = line.split("|")
|
| 48 |
... if beg:
|
| 49 |
... pass
|
| 50 |
... elif ctrl:
|
| 51 |
... beg = ctrl
|
| 52 |
... else:
|
| 53 |
... print "No ctrl or beg!!"
|
| 54 |
... if end:
|
| 55 |
... batesRange = FixBatesRange_func.EnumerateBates(beg, end)
|
| 56 |
... if ctrl:
|
| 57 |
... pass
|
| 58 |
... else:
|
| 59 |
... ctrl = beg
|
| 60 |
... outputFile.write(ctrl + "|" + beg + "|"+end+"|")
|
| 61 |
... for i in batesRange:
|
| 62 |
... outputFile.write(i + ";")
|
| 63 |
... outputFile.write("\n")
|
| 64 |
...
|
| 65 |
>>> outputFile.close()
|
| 66 |
>>> |