csv-to-keyvalue-file

0.0.3 • Public • Published

csv-to-keyvalue-file

Convert csv file to json or properties or other file

Usage

  Usage
  $ csv-to-keyvalue <"json" or "properties"> --args

    Required arguments
        <common required args>
        --src, -s               specify source json or properties file
        --dst, -d               specify destination file path
        --keyColumn, -k         specify key column
        --valueColumnm, -v      specify value column

  Examples
      $ csv-to-keyvalue json --src=example.csv --dst=dict.json --keyColumn=en --valueColumn=ko
      $ csv-to-keyvalue properties --src=example.csv --dst=dict.properties --keyColumn=en --valueColumn=ko

Example

You can obtain the data below by executing the command below to the data below.

csv-to-keyvalue json --src=example.csv --dst=dict.json --keyColumn=en --valueColumn=ko

  • Input: example.csv

ko,en
권총,pistol
돼지저금통,piggy-bank
브로치,Brooch
알약,pill
지갑,wallet
쌍안경,binoculars
꽃병,vase
...

  • Output: dict.json
{
  "권총": "pistol",
  "돼지저금통": "piggy-bank",
  "브로치": "Brooch",
  "알약": "pill",
  "지갑": "wallet",
  "쌍안경": "binoculars",
  "꽃병": "vase",
...
}

Package Sidebar

Install

npm i csv-to-keyvalue-file

Weekly Downloads

3

Version

0.0.3

License

MIT

Unpacked Size

8.54 kB

Total Files

8

Last publish

Collaborators

  • jopemachine