import uuid
item_format = '''
{TOP_FILTER}\\{PATH}
'''
def gen_item_group(top_filter, filename):
with open(filename, 'r') as f:
sources = f.readlines()
print(' ')
current_filter = ''
for s in sources:
s = s.replace('\n', '').replace('\r', '').replace('/','\\')
path = s.rpartition('\\')[0].replace('..\\', '')
print(item_format
.replace('{FILENAME}', s)
.replace('{TOP_FILTER}', top_filter)
.replace('{PATH}', path))
print(' ')
gen_item_group('Source Files', 'source.txt')
gen_item_group('Header Files', 'headers.txt')