Skip to content

premkumaranand/grunt-csv-concat-ext

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

grunt-csv-concat

Grunt plugin to concat CSV files in a given folder

Getting Started

This plugin requires Grunt ~0.4.5

If you haven't used Grunt before, be sure to check out the Getting Started guide, as it explains how to create a Gruntfile as well as install and use Grunt plugins. Once you're familiar with that process, you may install this plugin with this command:

npm install grunt-csv-concat-ext --save-dev

Once the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript:

grunt.loadNpmTasks('grunt-csv-concat-ext');

The "csv_concat" task

Overview

In your project's Gruntfile, add a section named csv_concat to the data object passed into grunt.initConfig().

grunt.initConfig({
  csv_concat: {
    options: {
      // Task-specific options go here.
    },
    your_target: {
      // Target-specific file lists and/or options go here.
    },
  },
});

Options

options.delimiter

Type: String Default value: ','

What are the columns delimited by?

options.src

Type: String Default value: ''

Source directory where the csv files are

options.dest

Type: String Default value: ''

Destination file where the concatd CSVs are placed into

options.addPrefixToKey

Type: Boolean Default value: false

Generate a prefix for the keys from the folder structure and the file name?

Usage Examples

grunt.initConfig({
  csv_concat: {
    options: {
      delimiter: '|',
      src: __dirname + '/test/fixtures',
      ignore: 'ignore.csv',
      dest: __dirname + '/test/tmp/final.csv'
    }
  }
});

Contributing

In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code using Grunt.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published