Giter VIP home page Giter VIP logo

csv-do's Introduction

csv-do

Command line utilities for CSV based on NodeJS. Split, Group, Aggregate, Mix, Merge csv files.

Install

npm i csv-do -g

How to Use

csv-do is a command line utility that provides the following commands:

  1. split: You provide an --input-file and a --column number that has values to group content by and splits one csv file into different files based on the content of that column.
#split myfile.csv by the content of the 2nd column. Drop the files in folder ./split
csv-do split --input-file ./myfile.csv --columns 2 --output-folder ./split/

#split myfile.csv by the content of the 2nd and 5th columns combined. Drop the files in folder ./split
csv-do split --input-file ./myfile.csv --columns 2,5 --output-folder ./split/

#split myfile.csv in files of 100 rows maximum. Drop the files in folder ./split
csv-do split --input-file myfile.csv --chunk-size 100 --output-folder ./split/
  1. compare: You provide two file paths (--file1 and --file2) and the system will highlight differences between the two files in records found by those columns.
#compare file1.csv against file2.csv row by row.
csv-do compare --file1 ./file1.csv --file2 ./file2.csv

#compare file1b.csv against file2.csv row by row.
csv-do compare --file1 ./file1b.csv --file2 ./file2.csv

#compare file1c.csv against file2.csv by finding rows in file2.csv that match those in file1c.csv by the columns specified in --search-columns parameter.
csv-do compare --file1 ./file1b.csv --file2 ./file2.csv --search-columns \"5,16,20\"

csv-do's People

Contributors

janunezc avatar

Watchers

James Cloos avatar  avatar

csv-do's Issues

Implement Compare by Search Column Keys

As a user of csv-do
I want the utility to compare two files, by searching in file2 records from file1 that match by a column keys specification
So that content can be compared regardless of order of rows.

csv-do compare --file1 ./file1b.csv --file2 ./file2.csv --search-columns "5,16,20"

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.