GithubHelp home page GithubHelp logo

swordencao / csv2md Goto Github PK

View Code? Open in Web Editor NEW

This project forked from pstaender/csv2md

0.0 1.0 0.0 15 KB

Convert csv data to markdown tables

License: MIT License

JavaScript 71.20% CoffeeScript 28.80%

csv2md's Introduction

Transform csv data to markdown table data

Install with:

  $ (sudo) npm install -g csv2md

Small tool to convert (large) csv tables to markdown tables. Is able to process stdin or csv files.

Usage

  $ csv2md data.csv > data.md

You can also pipe (larger files):

  $ cat data.csv | csv2md

  | max_i | min_i | max_f | min_f |
  |---|---|---|---|
  | -122.1430195 | -122.1430195 | -122.415278 | 37.778643 |
  | -122.1430195 | -122.1430195 | -122.40815 | 37.785034 |
  | -122.4194155 | -122.4194155 | -122.4330827 | 37.7851673 |
  $ cat data.csv | csv2md > data.md

The pretty option will pad cells to uniform width, but will disable stream output.

  $ csv2md --pretty data.csv > data.md

  | max_i        | min_i        | max_f        | min_f      |
  |--------------|--------------|--------------|------------|
  | -122.1430195 | -122.1430195 | -122.415278  | 37.778643  |
  | -122.1430195 | -122.1430195 | -122.40815   | 37.785034  |
  | -122.4194155 | -122.4194155 | -122.4330827 | 37.7851673 |

Options

Use -h for more command options:

  $ csv2md -h

Tests

Ensure that you have mocha installed npm install -g mocha, then run:

  $ npm run test

TODO

  • file writing

csv2md's People

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.