https://github.com/tomgp/dsv-splitter
Split DSV files (i.e. CSV, TSV etc.) into smaller chunks
https://github.com/tomgp/dsv-splitter
Last synced: 8 months ago
JSON representation
Split DSV files (i.e. CSV, TSV etc.) into smaller chunks
- Host: GitHub
- URL: https://github.com/tomgp/dsv-splitter
- Owner: tomgp
- License: mit
- Created: 2018-09-13T19:56:24.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2018-09-13T20:39:45.000Z (over 7 years ago)
- Last Synced: 2025-02-14T16:40:26.931Z (over 1 year ago)
- Language: JavaScript
- Size: 253 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# dsv-splitter
Split a delimiter separated values file into a set of smaller files with values separated by the same delimeters.
The first line of the input file is assumed to be the column headings and is repeated at the top of each output file. (TODO, provide an options to not have this happen)
## command line
```
npm i -g @tomgp/dsv-splitter
```
```
Options:
-f, --file [value] a file path (required)
-d, --delimiter [value] (default value ',')
-l, --lines [value] an integer (default value 100)
-o, --output [value] output directory (default value your current working directory)
-h, --help output usage information
```
e.g. `dsvSplitter -f test-data/books.csv -o test-output/`
or `dsvSplitter --file giantSpreadSheet.tsv --delimiter "\t" --lines 1000`
## require it
```
npm i @tomgp/dsv-splitter
```
```
const { splitDSV } = require('@tomgp/dsv-splitter');
splitDSV( commander.file, commander.delimiter, commander.lines, commander.output );
```