Skip to content

Latest commit

 

History

14 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 

Repository files navigation

📊 CSV Data Processor

A simple command-line tool for processing, analyzing, and transforming CSV data files.

✨ Features

  • 📋 Read and write CSV files with custom delimiters
  • 🔍 Filter rows based on column values
  • 🔀 Sort data by any column
  • 📈 Count value occurrences in columns
  • ✂️ Select and extract specific columns
  • 📊 Display data in a readable tabular format

🚀 Installation

  1. Clone this repository:
git clone https://github.com/0xFauc3t/csv-processor.git
cd csv-processor
  1. Make the script executable (Unix/Linux/macOS):
chmod +x main.py

🔍 Usage

python main.py <input_file.csv> [options]

⚙️ Options

  • input: Input CSV file (required)
  • -o, --output: Output CSV file
  • -d, --delimiter: CSV delimiter (default: ,)
  • --filter COLUMN VALUE: Filter rows where COLUMN equals VALUE
  • --sort COLUMN: Sort by column
  • --reverse: Reverse sort order
  • --count COLUMN: Count values in a column
  • --select COLUMNS: Select only specified columns (comma-separated)
  • --limit N: Limit output rows displayed

📝 Examples

Display CSV data:

python main.py data.csv

Filter rows by column value:

python main.py data.csv --filter Country "United States"

Sort data by a column:

python main.py data.csv --sort Age

Sort in descending order:

python main.py data.csv --sort Salary --reverse

Count values in a column:

python main.py data.csv --count Category

Select specific columns:

python main.py data.csv --select Name,Email,Phone

Save processed data to a new file:

python main.py data.csv --filter Department IT --sort Salary --reverse -o it_salaries.csv

Work with different delimiter:

python main.py data.csv -d ";" --output processed.csv

💡 Tips

  • For best display results, use with small to medium-sized CSVs
  • When working with large files, always use the --output option to save results
  • Use the --limit option to preview just a few rows of large datasets
  • Combine multiple operations (filter, sort, select) to perform complex transformations

📄 License

This project is licensed under the MIT License - see the LICENSE file for details.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages