DEV Community

Mate Technologies
Mate Technologies

Posted on

File Search System v1.0.2 – High-Performance Desktop File Search Tool

Managing large directories and searching for specific content across multiple file types can be tedious. That’s why I built File Search System, a Python-based desktop application designed to quickly search through directories, inspect file contents, and present results efficiently—all without blocking your workflow.

Grab it here: https://gum.new/gum/cmm07bx7y000604jm0fmp8jls

Key Features
Recursive folder & content search – scan entire directory trees effortlessly.
Multi-format support – search inside .txt, .csv, .xlsx, .pdf, .xml files.
Flexible search options – Regex, whole-word, and case-sensitive matching.
Real-time feedback – progress bar, speed, ETA, and match counter.
Pause, resume, and stop – full control over long searches.
Result preview & export – view matches and export results to CSV.
Safe multi-threaded scanning – keeps the UI responsive.
Built With
Python – core logic and file handling
Tkinter + ttkbootstrap – modern and themed UI
PyPDF2 – PDF text extraction
xlrd – Excel sheet parsing
PyInstaller – packaged as a standalone Windows EXE
Usage
Set your root folder
Browse to the folder you want to scan.
Enter your search term
Enable Regex, Case, or Whole Word options as needed.
Filter file types and exclude folders
Example: *.txt *.csv and exclude node_modules .git pycache.
Start the search
Use the Search button to begin scanning. Monitor progress, speed, ETA, and matches in real-time.
Pause or stop anytime
Pause or stop the search without losing the UI state.
Export results
Export all matches to a CSV file with file paths and content previews.
Code Overview

Here’s a snippet of the core search logic:

def read_file(path, pattern, flags):
    if path.lower().endswith((".txt",".csv")):
        with open(path,"r",errors="ignore") as f:
            for i,l in enumerate(f,1):
                if re.search(pattern,l,flags):
                    return f"Line {i}: {l.strip()[:100]}"
    elif path.lower().endswith(".pdf"):
        with open(path,"rb") as f:
            r = PyPDF2.PdfReader(f)
            for i,p in enumerate(r.pages):
                t = p.extract_text()
                if t and re.search(pattern,t,flags):
                    return f"Page {i+1}"
    elif path.lower().endswith(".xlsx"):
        wb = xlrd.open_workbook(path)
        for sh in wb.sheets():
            for r in range(sh.nrows):
                for c in range(sh.ncols):
                    v = str(sh.cell_value(r,c))
                    if re.search(pattern,v,flags):
                        return f"{sh.name} R{r+1}C{c+1}"
Enter fullscreen mode Exit fullscreen mode

This function ensures efficient matching for multiple file types while handling large files safely.

Why File Search System?
Speed – handles thousands of files with minimal lag.
Clarity – results are presented cleanly with previews.
Reliability – multi-threaded and error-logged for stable operation.

You can download and try File Search System v1.0.2 here: https://gum.new/gum/cmm07bx7y000604jm0fmp8jls

Top comments (0)