1.1.0 • Published 6 years ago

csv12n v1.1.0

Weekly downloads
3
License
ISC
Repository
github
Last release
6 years ago

csv12n

convert a big csv file to many small ones

Getting Started

npm i csv12n

Usage

const csv12n = require('csv12n')

const source = __dirname + '/source.csv'
const target = __dirname + '/csv/'

csv12n(source, target, {
    prefix: 'test',
    headerLines: 1,
    dataLines: 2,
    progress: console.log,
})

csv12n(source, target, {
    prefix: 'test',
    headerLines: 1,
    dataLines: 2,
    // progress: console.log,
    encoding: 'utf8',
})

 // => source content
 // a,b,c
 // 1,2,3
 // 4,5,ʤ
 // 7,8,9
 
 // => target content test-0.csv
 // a,b,c
 // 1,2,3
 // 4,5,ʤ
 
 // => target content test-1.csv
 // a,b,c
 // 7,8,9

Test

npm test