0.0.2 • Published 10 years ago
nsplit v0.0.2
nsplit
Node.js implemented split funciton for split text file in line size. You can specify the tmp dir for put temp file during split file, and output folder for put final closed file.
Install
npm install nsplit -gUsage
Help page:
nsplit -h
Usage: node nsplit [options]
Options:
-t, --tmp Temp folder for puting processing file
-o, --output Output folder for puting done file
-l, --line Separate by size of lines
-c, --callback Execute a callback script or command when every file done
-e, --exec Execute a script or command
-d, --debug Execute debug mode
--version print version and exitSplit sample
Full command parameters:
nsplit -t /tmp/temp -o /tmp/output -l 300 -e 'echo done' sample.txtWith each file cloud event:
nsplit -t /tmp/temp -o /tmp/output -l 300 -c 'echo this done file is:' -e 'echo done' sample.txtMaybe you can integrate with cloud:
nsplit \
-t /tmp/temp -o /tmp/output \
-l 300 \
-c 'gzip $file && gsutil cp $file.gz gs://qnap-transfer/' \
-e 'echo done' sample.txtSimple split:
nsplit -o /tmp/output sample.txt