If the columns are always in the same order and there are always the same number, you can just use the .split()
method on the string, and find the one you want with an index:
words = line.split()
l = words[4]
temp = l.split("=")[2]
if int(temp) <= 50:
# found the line, handle it
do_something_here()
If the columns might be in any order, you could use regular expressions.
s_pat = "length\s*=\s*(\d+)"
pat = re.compile(s_pat)
m = pat.search(line)
if m:
temp = m.group(1)
if int(temp) <= 50:
# found the line, handle it
do_something_here()
This uses the "match group" from the regular expression to grab the number.
P.S. Two answers appeared while I was writing this. I am not the fastest gun in the west.