def get_site_files():
    sites = defaultdict(list)
for fname in glob.glob('*.txt'):
    parts = fname.split('.')
if len(parts) == 6 and parts[2] == 'WRFc36':
    sites[parts[0]].append(fname)
return sites

def main():
    for site, files in get_site_files().items():
        print(site, files)
if __name__ == '__main__':
    main()
extract columns from multiple text file with Python