python
import os
import re
filelist=[]
path = “/Volumes/C/work/veridian/issue/SMP_LAN_DOE/8-3A/”
#path = “/Volumes/C/work/veridian/SPC_calibration/calibration_logs/”
dict = {}
unitID = []
temperature = []
ggTemperature = []
passfail = []
flow = “”
unitID1 = 0
temperature1 = 0
ggTemperature1 = 0
testTime = 0
testflag = “”
filesummay = open(‘issue_report.txt’, ‘w’)
filesummay.write(‘unitID1’)
filesummay.write(’\t’)
filesummay.write(‘flow’)
filesummay.write(’\t’)
filesummay.write(str(‘acc’))
filesummay.write(’\t’)
filesummay.write(str(‘B voltage-4.45’))
filesummay.write(’\t’)
filesummay.write(‘testflag’)
filesummay.write(’\t’)
filesummay.write(‘errCode’)
filesummay.write(’\t’)
filesummay.write(‘file’)
filesummay.write(’\n’)
errCode = ‘’
for root, dirs, files in os.walk(path):
for name in files:
if name.endswith(".log"):
print(name)
print("************************")
with open(os.path.join(root,name),‘r’) as f:
txt=f.readlines()
keys=[k for k in range(0,len(txt))]
result={k:v for k,v in zip(keys,txt[::-1])}
for i in range(7):
print(result[i])