2026-02-21 02:01:12 +01:00
2026-02-12 09:51:22 +01:00
2026-02-21 02:01:12 +01:00
2026-02-21 02:01:12 +01:00
2026-02-21 02:01:12 +01:00
2026-02-21 02:01:12 +01:00
2026-02-12 09:51:22 +01:00
2026-02-21 02:01:12 +01:00
2026-02-12 09:51:22 +01:00
2026-02-21 02:01:12 +01:00
2026-02-21 02:01:12 +01:00
2026-02-21 02:01:12 +01:00

Excel Filter Tool

A Python application for filtering Excel files based on regex patterns with both CLI and GUI interfaces.

Overview

The Excel Filter Tool allows you to:

  • Analyze Excel files without opening them
  • Filter rows based on configurable regex patterns
  • Create new Excel files with filtered data
  • Use a graphical interface or command line
  • Configure settings via JSON files

Quick Start

Pre-built installer available!

Download and run ExcelFilterSetup.exe from the dist/ directory for automatic installation including Python and all dependencies.

OR use the provided batch files:

  • launch_gui_tkinter.bat - Launches the Tkinter GUI (recommended)
  • launch_gui.bat - Launches the PySimpleGUI interface
  • launch_cli.bat - Launches the command line version

macOS/Linux Users

cd excel_filter
pip install -r requirements.txt
python -m src.excel_filter.gui

For CLI usage:

python -m src.excel_filter.main --input input.xlsx --output output.xlsx --pattern "error|warning"

Command Line Usage

python -m src.excel_filter.main --input input.xlsx --output output.xlsx --pattern "error|warning"

Graphical Interface

python -m src.excel_filter.gui

Usage Guide

Basic Filtering

python -m src.excel_filter.main --input data.xlsx --output filtered.xlsx --pattern "error|warning|critical"

Filter Specific Columns

python -m src.excel_filter.main --input data.xlsx --output filtered.xlsx --pattern "active" --columns "Status Message"

Using Configuration Files

Create a config.json file:

{
    "input_file": "input.xlsx",
    "output_file": "output_filtered.xlsx",
    "pattern": "error|warning|critical",
    "sheet_name": "Sheet1",
    "columns": ["Status", "Message", "Description"]
}

Then run:

python -m src.excel_filter.main --config config.json

Regex Patterns

The tool uses Python's re module. Examples:

  • error|warning - Match "error" or "warning"
  • ^A.* - Lines starting with "A"
  • \d{3} - Three-digit numbers
  • [A-Z].* - Lines starting with capital letter

Packaging & Distribution

Build Executable

pip install pyinstaller pandas openpyxl customtkinter
python build_executable.py

Create Installer

double-click build_installer.bat

This creates ExcelFilterSetup.exe that:

  • Installs the application as a native Windows executable
  • Automatically installs Python and dependencies if needed
  • Creates desktop and Start menu shortcuts

Technical Details


### Key Components

- **ExcelFilter Class**: Core filtering functionality
- **CLI Interface**: Command line processing
- **GUI Interface**: Graphical interface
- **Configuration Management**: JSON-based settings

### Dependencies

- `openpyxl` - Excel file operations
- `pandas` - Data manipulation
- `customtkinter` - GUI interface


## Examples

### Filter Log Files

```bash
python -m src.excel_filter.main --input logs.xlsx --output errors.xlsx --pattern "error|warning"

Filter Customer Data

python -m src.excel_filter.main --input customers.xlsx --output active_customers.xlsx --pattern "active" --columns Status

Filter Numeric Data

python -m src.excel_filter.main --input sales.xlsx --output high_sales.xlsx --pattern "1000.*" --columns Amount
Description
No description provided
Readme 39 MiB
Languages
Python 95.9%
Batchfile 3%
Inno Setup 0.5%
Shell 0.3%
Dockerfile 0.3%