#!/cygdrive/c/python32/python
import subprocess
import pdb

inf = open('bird_class')
out = open('bird_new', 'w')
#pdb.set_trace()
for i in inf:
    if 'bird:' in i:
        i = i.rstrip('\n')
        lines = i.split(':')
        if len(lines) < 4: print ('error: ', lines)
        new = lines[0] + ':' + lines[1] + ':' + lines[3] + ':' + '1'
        length = len(lines)
        if (length > 4):
            new += ':' + lines[4]
        else:
            new += ':'
        if (length > 5):
            new += ':' + lines[5]
        else:
            new += ':'
        out.writelines(new + '\n')
    else:
        out.writelines(i)
