import os import re root_dir = "/Volumes/Data/project/Antigravity/Wiki" patterns = [ re.compile(r"지식 요약 정보 추출 중"), re.compile(r"본문 구조화 작업 중") ] deleted_count = 0 for root, dirs, files in os.walk(root_dir): for file in files: if file.endswith(".md"): file_path = os.path.join(root, file) try: with open(file_path, 'r', encoding='utf-8') as f: content = f.read() if any(p.search(content) for p in patterns): os.remove(file_path) print(f"Deleted: {file_path}") deleted_count += 1 except Exception as e: print(f"Error processing {file_path}: {e}") print(f"\nTotal deleted: {deleted_count}")