node package manager
Loosely couple your services. Use Orgs to version and reuse your code. Create a free org »

csvnorm

Csvnorm

Command line tool to normalize CSV and *SV files.

Steps:

  • Convert to UTF-8 encoding
  • Replace separator with ,
  • Reformat
    • Date columns to ISO8601
    • Number columns to 1456.25
    • Currency columns to 1539.16 $

CLI Version

Installation

npm install --global csvnorm
yarn global add csvnorm

Usage

csvnorm data.csv
cat data.csv | csvnorm

TODO

  • Print debugging info in TTY mode

Node Module

Installation

npm install --save csvnorm
yarn add csvnorm

Usage

With files:

const csvnorm = require('csvnorm')
 
csvnorm({
  filePath: csvFilePath,
  inPlace: true,
})

With streams:

const csvnorm = require('csvnorm')
 
csvnorm({
  readableStream: process.stdin,
  writableStream: process.stdout,
})