Say we have a CSV in a buffer:

foo,bar,hello
1,234,95
8923,901,145

Are there any native Emacs or Markdown-mode built-ins in Emacs that can be used to convert it to a Markdown table? It looks like the syntax is quite different:

| Tables        | Are           | Cool  |
| ------------- |:-------------:| -----:|
| col 3 is      | right-aligned | $1600 |
| col 2 is      | centered      |   $12 |
| zebra stripes | are neat      |    $1 |
  • Would a series of regex replacements work, or do you want something less general? – PythonNut Aug 11 '15 at 17:44
  • An idea: select the region containing the csv content, then M-x org-table-create-or-convert-from-region (to do this org mode should be enabled), in this way you obtain an org-table. Then there is the command M-x org-md-export-as-markdown. I am not sure if this output is the one you would like to obtain. – Name Aug 11 '15 at 18:30

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Browse other questions tagged or ask your own question.