Skip to content

Yhamenite/CSVXLCD

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

9 Commits
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

🧹 Batch CSV Column Remover

A Python automation tool designed to efficiently remove specific columns from multiple CSV files simultaneously. It utilizes a user-friendly terminal interface with color-coded prompts to guide you through selecting deletion ranges using standard Excel column letters (e.g., A, Z, AA).

Note: This tool processes data safely by creating a separate output directory, ensuring your original files remain untouched.

πŸ“‘ Table of Contents

πŸš€ Features

  • Batch Processing: transform an entire directory of CSV files in seconds.
  • Excel-Style Indexing: Define columns using letters (A, B, AA) rather than confusing zero-based numerical indices.
  • Safe Execution: Automatically generates a specific output folder (03-deleted_unwanted_features) for cleaned files.
  • Interactive CLI: Features a colored command-line interface (Blue for info, Green for success, Red for errors, Yellow for warnings).
  • Smart Validation: Checks for valid range pairs and existing directories to prevent errors.

πŸ“‹ Prerequisites

To run this tool, ensure you have Python 3.x installed. The script relies on the following external libraries:

  • pandas (for data manipulation)
  • numpy (for numerical operations)

βš™οΈ Installation

  1. Clone this repository (or download the script):

    git clone https://github.com/Yhamenite/CSVXLCD.git
  2. Install the required dependencies using pip:

    pip install pandas numpy

πŸ› οΈ How to Use

  1. Run the script from your terminal:

    python main.py
  2. Provide Input Directory: The script will ask: [*] Please provide the input directory:

    • Paste the path to the folder containing your raw CSV files.
  3. Define Deletion Ranges: The script will ask: Deletion ranges:

    • Enter your column ranges separated by commas.
    • Crucial: You must provide pairs of Start and End columns.

πŸ“ Input Syntax

The tool accepts ranges in the format: Start,End,Start,End.

Example: If you enter: A,C,F,H

  • Range 1: Deletes columns from A to C (inclusive).
  • Range 2: Deletes columns from F to H (inclusive).

πŸ“‚ Directory Structure

The tool keeps your workspace organized. When you run the script, it creates a dedicated output folder.

Your_Project_Root/
β”‚
β”œβ”€β”€ main.py                     # This script
β”œβ”€β”€ input_data_folder/          # Your source folder
β”‚   β”œβ”€β”€ data_file_01.csv
β”‚   └── data_file_02.csv
β”‚
└── 03-deleted_unwanted_features/   # 🟒 Output folder (Created Automatically)
    β”œβ”€β”€ data_file_01.csv            # Cleaned file
    └── data_file_02.csv            # Cleaned file

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors