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.
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.
- 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.