This week's sponsor


The first subscription service for Mac apps

Workflow: Convert Spreadsheets to MultiMarkdown Tables

Going from a spreadsheet to a MultiMarkdown table with a workflow on iOS.

Going from a spreadsheet to a MultiMarkdown table with a workflow on iOS.

This is a proof of concept that I put together out of curiosity today, and it'll likely break for some documents or Microsoft Excel, but it's been working well for me, and I thought I'd share it.

I created a workflow that converts colums/rows copied from spreadsheets in Numbers and Google Sheets to a MultiMarkdown table.

I never understood how to write MultiMarkdown tables manually, and I prefer the experience of apps like Numbers and Sheets, which allow me to easily navigate between cells, modify text that's already been entered, and copy selections with the tap of a button. However, all my writing is done in Markdown, and I didn't have an easy way to convert the output of Numbers and Sheets into text that could be understood by Editorial and processed to HTML for MacStories. So, I wrote a workflow that converts text copied from a spreadsheet to a Markdown table that Editorial (and other apps like Byword) can preview and convert to HTML.

To use the workflow, you need to:

  1. Select columns/rows in a spreadsheet and copy them;
  2. Run the workflow, which will save output to the system clipboard;
  3. Paste the result in apps that can preview Markdown tables (like Editorial) and preview the table.

The workflow is based on a number of assumptions you need to keep in mind:

  • It splits text at tab characters (what Numbers and Google Sheets use to separate cells when copying them as text ) so cells that already contain a tab won't likely work with it;
  • It generates placeholder “Headers” in the Markdown table – you have to edit these yourself in your text editor of choice;
  • Because the syntax for MultiMarkdown tables is heavily based on the pipe character ( | ), spreadsheets that contain it may have issues with the workflow.

The workflow has been working beautifully for the “basic” spreadsheets I have: I can now copy text, run the workflow, and end up with a fully assembled MultiMarkdown table that I can paste in Editorial. All I need to do is change the “Header” placeholder with what I want – I could have used the first row of a spreadsheet for the headers' names, but I figured it'd be better to change the final output manually.

With this workflow, I can go from this:

To this, in two seconds:

I'm excited about the possibility of turning Google Sheets documents (which I'm using with Zapier quite a bit) into tables I can put on MacStories without leaving my iPad or writing a complex Python script for the task.

You can download the workflow here. If you have improvements/suggestions, I'd love to hear from you.

Unlock MacStories Extras

Club MacStories offers exclusive access to extra MacStories content, delivered every week; it’s also a way to support us directly.

Club MacStories will help you discover the best apps for your devices and get the most out of your iPhone, iPad, and Mac. Plus, it’s made in Italy.

Starting at $5/month, with an annual option available. Join the Club.

A Club MacStories membership includes:

  • MacStories Weekly newsletter, delivered every week on Friday with app collections, tips, iOS workflows, and more;
  • Monthly Log newsletter, delivered once every month with behind-the-scenes stories, app notes, personal journals, and more;
  • Access to occasional giveaways, discounts, and free downloads.