Skip to content

Instantly share code, notes, and snippets.

View rupeshs's full-sized avatar
🎯
Refocusing

Rupesh Sreeraman rupeshs

🎯
Refocusing
View GitHub Profile
@rupeshs
rupeshs / search_code.py
Last active August 11, 2025 02:57
Search code with n number of lines above and below
import glob
import os
# === CONFIG ===
SEARCH_DIR = r"G:\2025\tests\fastsdcpu\src" # Change to your folder
SEARCH_TERM = "test" # Search string
CONTEXT_LINES = 0 # Lines above & below
CASE_SENSITIVE = True # Set False for case-insensitive
OUTPUT_FILE = "result.txt"
# ==============