Skip to content

A very simple markdown table to CSV converter with no dependencies

Notifications You must be signed in to change notification settings

halcyonseeker/mdtable2csv

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

mdtable2csv.awk

A simple AWK script for converting Github-Flavoured Markdown tables to RFC4180 CSV spreadsheets. Consequently, it also has reasonable support for org-mode tables and general plain-text tables created using Emacs' table.el. I've been using this script with GAWK, but I believe it would work with other AWK implementations as well.

Installation and Usage

To install or uninstall just run make install or make uninstall as root; PREFIX defaults to /usr/local.

Usage is dead simple with no options:

mdtable2csv < table.md > spreadsheet.csv

Note that the input must only contain a table, bizarre and undesirable things will happen if you try to convert an arbitrary markdown file. This is quite useful when used in conjunction with a text-editor that lets you pipe the selected region into an external program.

Bugs and Limitations

  • Uneven rows are not supported and will result in mangled output.
  • Forgoing leading or trailing pipes will result in columns being dropped
  • We don't handle colon alignment directives very well.
  • Org-mode table delimeter rows that use + rather than | at cell boundaries are not supported.

About

A very simple markdown table to CSV converter with no dependencies

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published