🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

csvnorm

Package Overview
Dependencies
Maintainers
1
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

csvnorm

Command line tool to normalize CSV and *SV files.

0.6.0
Source
npm
Version published
Weekly downloads
36
9.09%
Maintainers
1
Weekly downloads
 
Created
Source

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

Usage:
  csvnorm [Options] INFILE [> OUTFILE]
  csvnorm [Options] < INFILE [> OUTFILE]

Options:
  --encoding    Overwrite detected input encoding                       [string]
  --in-place    Normalize CSV file in place           [boolean] [default: false]
  --skip-start  Skip lines at the start of the input       [number] [default: 0]
  --version     Show version number                                    [boolean]
  --help        Show help                                              [boolean]

Examples:
  csvnorm input.csv > normalized.csv        Normalize a CSV file
  cat input.csv | csvnorm > normalized.csv  Pipe and normalize a CSV file

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,
})

TODO

  • Print debugging info in TTY mode
  • Improve encoding detection (e.g. fork and update https://github.com/finnp/to-utf-8)
  • Implement skipLinesEnd

Keywords

csv

FAQs

Package last updated on 20 Jan 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts