import re
fname = "wgetz.txt"
f = open(fname)

tf = 0.0
tp = 0.0
tc = 0.0
i = 0
id1 = 0
for line in f:
    i += 1
    if re.compile(r'ID').match(line):
        id1 += 1
    if re.compile(r'DR(.)+F:').match(line):
        tf += 1
    if re.compile(r'DR(.)+P:').match(line):
        tp += 1
    if re.compile(r'DR(.)+C:').match(line):
        tc += 1

print 'All str:', i
print 'F:', tf
print 'P:', tp
print 'C:', tc
allt = tf + tp + tc
print 'all', allt
print 'id', id1
print '******************'
print 'F:,%', tf/allt*100
print 'P:,%', tp/allt*100
print 'C:,%', tc/allt*100
