A simple command-line tool for processing, analyzing, and transforming CSV data files.
- 📋 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
- Clone this repository:
git clone https://github.com/0xFauc3t/csv-processor.git
cd csv-processor- Make the script executable (Unix/Linux/macOS):
chmod +x main.pypython main.py <input_file.csv> [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
python main.py data.csvpython main.py data.csv --filter Country "United States"python main.py data.csv --sort Agepython main.py data.csv --sort Salary --reversepython main.py data.csv --count Categorypython main.py data.csv --select Name,Email,Phonepython main.py data.csv --filter Department IT --sort Salary --reverse -o it_salaries.csvpython main.py data.csv -d ";" --output processed.csv- For best display results, use with small to medium-sized CSVs
- When working with large files, always use the
--outputoption to save results - Use the
--limitoption to preview just a few rows of large datasets - Combine multiple operations (filter, sort, select) to perform complex transformations
This project is licensed under the MIT License - see the LICENSE file for details.