On 20/08/07, Shawn Milochik <[EMAIL PROTECTED]> wrote: > Hopefully this will help (using your input file) > > #!/usr/bin/env python > import re > buildinfo = "input.txt" > input = open(buildinfo, 'r') > > regex = re.compile(r"^\s*build.number=(\d+)\s*$") > > for line in input: > if re.search(regex, line): > print line > buildNum = re.sub(r"^\s*build.number=(\d+)\s*$", "\\1", line) > print line > print buildNum > --
If I misunderstood the original post and the build number is all that is required from the file, then: buildNum = open('input.txt').read().split('build.number=')[1].split()[0] :) -- http://mail.python.org/mailman/listinfo/python-list