import os

from itertools import ifilter

def filter_nulls(file):
	with open(file,'rb') as f,open('new.txt','wb') as g:
		g.writelines( ifilter(lambda line: 'lang id="0"' not in line, f))
	
	f.close()
	g.close()
	os.remove(file)
	os.rename('new.txt', file)


for root, dirs, files in os.walk('.'):
    for file in files:
        if file.endswith('.lang'):
            print filter_nulls(file);

