csv12n

1.1.0 • Public • Published

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

Dependencies (3)

Dev Dependencies (0)

    Package Sidebar

    Install

    npm i csv12n

    Weekly Downloads

    2

    Version

    1.1.0

    License

    ISC

    Unpacked Size

    4.48 kB

    Total Files

    7

    Last publish

    Collaborators

    • fanlia