Using the dash Library to Work with Org Tables

The other day, I wrote about building and exporting tables from Org code blocks. I used Elisp but, of course, you can use any of the languages supported by Org Babel. In one of the examples, I showed how to build an output summary table with the low and high values from a couple of columns but didn’t bother to show the code to calculate those values. I just put in a comment about “routine code to calculate the values.”

Heikki Lehvaslaiho took that as a challenge and a chance to extend his Elisp skills to working with tables. He has a very nice solution leveraging Magnar Sveen’s dash library. I especially like his use of the -select-column function to extract a column from the table. There’s nothing magic about the function, of course; it does pretty much what you’d expect. The nice thing about it is that it saves you from having to write the tedious extraction code yourself.

There are several functions in the library that make working with tables (in the Org mode sense) easier. If you process Org tables frequently, you should definitely take a look at the library; it will make your life a little easier.

This entry was posted in General and tagged , . Bookmark the permalink.