In [35]:
import re
count = 0
lst = list()
fhand = open('regex_sum_1573962.txt')
for line in fhand :
line = line.strip()
number = re.findall('[0-9]+', line)
if len(number) > 0 :
for x in number :
count = count + float(x)
print(int(count))
346596
In [ ]: