Using re.findall method to extract data
<p>I am writing a program to extract data (<code>New Revision: 39772</code>) from text file (mbox.txt link -<a href="https://drive.google.com/open?id=0B3T5goLL8BbXWmFkOGR3RHgzWHc" rel="nofollow">google drive link for file </a>)</p>

<p>I completed the task by using normal method but I want to do it by using <code>re.findall</code> method.</p>

<pre><code>import re
print "Please enter file path only"
text_file = raw_input ("Enter the file name:")
print "Trying to open the file that you have entered"
try:
    open_file = open ( text_file )
    print "Text file " + text_file + " is opened"

except:
    print "File not found"
    raise SystemExit
# using normal method     
count = 0
total = 0.0
using regular expresion
for line in open_file: 
    if 'New Revision:' in line:   
        print line
        total += float(line.split()[-1])
        count = count + 1
        Avg = total/count
print "The number of line with 'New Revision:' is:", count
print "The total of the floating point numbers at the end of the 'New   Revision:'is:", total
print "Average:",round(Avg,1)

#using findall()method 

numlist = [];
for line in open_file:
   line = line.rstrip()
   Extract_data = re.findall('^New Revision:([0-9]+)',line)
   number = int(Extract_data[0])
   numlist.append(Extract_data)

print numlist
</code></pre>

<p>I want to extract the numbers at the end of <code>New Revision: 39772</code> and save it to the list by using <code>re.findall</code> method.
So far I read all the available documents on this site but I couldn't understand how to do it and getting wrong output.</p>