Giter Club home page Giter Club logo

csv-split's Introduction

CSV Split

Developed and tested on Ruby 2.4.0

A ruby script that splits a large csv file into smaller files and stores the smaller files into the split-files directory.

This script has eight parameters:

Options:
  -f, --file-path=<s>                         Path to csv file to be split
  -n, --new-file-name=<s>                     Name of the new files. This will be appended with an incremented number (default: split)
  -i, --include-headers, --no-include-headers Include headers in new files (default: true)
  -l, --line-count=<i>                        Number of lines per file (default: 1)
  -d, --delimiter=<s>                         Charcter used for Col. Sep. (Default: ,)
  -r, --remove-columns                        Specify column names to be removed during processing in remove_coluns.txt
  -c, --include-remainders                    Include remainder rows in the split files (default: false). Example: if there are 1030 rows in a csv file and will be split in 100 rows, the remaining 30 rows will be stored in a new file
  -h, --help                                  Show this message

Required Gems

Installation

  1. Clone repository
  2. Install the required gem:
    gem install optimist
    

Running the script

ruby csv-split.rb --file-path path/to/csv/file/.csv --line-count 2500 --include-headers

csv-split's People

Contributors

ahmadnaufal avatar imartingraham avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

csv-split's Issues

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.