Maya batch render log file filter

f = open('render1.txt', 'r')
# open output file ( if the file doesn't exist, create file )
o = open("out.txt", 'w')
# create an array to store all the lines for the output file
outList = []
# loop through each line
for line in f:
# split the line using the space character
split1 = line.split(" ")
# split the line using the colon character
split2 = line.split(":")
# test the number of words in the line ( if > 5 )
if len(split1) > 5:
# if line starts by "RC"
if split1[0] =="RC":
# if "wallclock" is found
if split1[7] =="wallclock":
# add to the output file Array
outList.append(line)
if split2[0] =="Result":
# add to the output file Array
outList.append(line)
# write the ouput file
o.write(''.join(outList))
# close both files
f.close
o.close







