Skip to content

Latest commit

 

History

History
50 lines (36 loc) · 2.89 KB

README.md

File metadata and controls

50 lines (36 loc) · 2.89 KB

CSV Data Transformer

A Node.js CLI tool for transforming and processing large CSV files. Supports filtering, aggregating, and modifying CSV data efficiently using streams. Ideal for processing data in various formats, cleaning, and preparing it for further use.

Features

  • Filter rows based on column values.
  • Aggregate data (e.g., sum, average) by specific columns.
  • Add, remove, or rename columns.
  • Export to CSV or JSON formats.

Installation

  1. clone repository
git clone [email protected]:Raphico/csv-data-transformer.git
cd csv-data-transformer
  1. install dependencies
npm install
  1. create symlink
npm link

Usage

csvtransform --help

Commands

Command Description Example
--input <filePath> Specifies the CSV file to process. --input data.csv
--output <filePath> Specifies the output file path and format (.csv or .json). --output result.json
--filter <condition> Filters rows based on a condition (e.g., column=value). --filter "status=active", --filter "status=active OR country=USA", --filter "status=active AND country=USA
--aggregate <type,column> Aggregates data, e.g., sum, average on a column. --aggregate "sum,sales"
--add-column <columnName=defaultValue> Adds a new column with a default value. --add-column "discount=0"
--remove-column <columnName> Removes a specified column. --remove-column "old_column"
--rename-column <oldName=newName> Renames a column. --rename-column "old_col=new_col"
--delimiter <character> Specifies the CSV delimiter (default is a comma). --delimiter ";"