for line in open('filename.txt', 'r'):
    if line.startswith('TestName') or line.startswith('Totals'):
        fields = line.rsplit(None, 5)
print('\t'.join(fields[:2] + fields[3:4]))
log file parsing python