"""Cross-reference all WizTree CSVs for 97-Server-G-Drive\VWP2\ paths. The .lnk shortcuts in VHDX-VWP1's Orders Versions folder all pointed to G:\VWP2\. """ import csv, glob SEARCH = '\\97-server-g-drive' SUB = '\\vwp2\\' hits = [] for csv_path in sorted(glob.glob('clients/valleywide/app-modernization/WizTree_2026*.csv')): with open(csv_path, encoding='utf-8-sig', errors='replace') as f: r = csv.reader(f); next(r); next(r) for row in r: if not row or len(row) < 4: continue pl = row[0].lower() if SEARCH in pl and SUB in pl: hits.append((csv_path.split('/')[-1], row[3], row[1], row[0])) print(f'Found {len(hits)} \\VWP2\\ matches across the three rotation drive CSVs') print() print('--- Folders + .exe + .vbp + .mdb matches, deduped ---') seen = set() for src, mod, sz, p in sorted(hits): if p in seen: continue seen.add(p) is_folder = p.endswith('\\') pl = p.lower() if is_folder or pl.endswith('.exe') or pl.endswith('.vbp') or pl.endswith('.mdb') or pl.endswith('.frm'): try: sz_int = int(sz) sz_str = f'{sz_int/1024/1024:>7.1f}MB' if sz_int >= 1024*1024 else f'{sz_int:>9}b' except ValueError: sz_str = sz print(f' [{src[-12:-4]}] {mod:<19} {sz_str} {p}')