Steve wrote:
Sorry I'm not being clear

****Input******
sold: 16
sold: 20
sold: 2
sold: 0
sold: <storefront>
7
0
<storefront>
sold
null

****Output****
16
20
2
0
0
7
0
0
0
0


Since you're looking for only digits, simply make a string containing all characters that aren't digits.

Now, loop through the file and use str.translate() to delete all the non-digits from each line, using the above table.

Check if the result is "", and if so, substitute "0".  Done.

DaveA

--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to