{"id":11024,"date":"2022-12-19T12:51:46","date_gmt":"2022-12-19T17:51:46","guid":{"rendered":"https:\/\/irreal.org\/blog\/?p=11024"},"modified":"2022-12-19T12:51:46","modified_gmt":"2022-12-19T17:51:46","slug":"building-an-exercise-table-from-a-journal","status":"publish","type":"post","link":"https:\/\/irreal.org\/blog\/?p=11024","title":{"rendered":"Building An Exercise Table From a Journal"},"content":{"rendered":"<p>Like many people, Simon Pugnet likes to keep a record of his exercising. His regime includes several types of exercise such as running, sit-ups, and pushups. Also like many of us, he maintains a daily journal so, of course, it made sense to record the exercising in his (Org mode) journal. He does this by adding a third level headline for each exercise under the second level headline <code>Exercises<\/code>. The first level headlines are the date so this gives Pugnet an \u201cExercises\u201d headline for each day.<\/p>\n<p>You may not think this is an optimal setup but it\u2019s a reasonable one. Now, however, Pugnet wanted to generate a table of his daily exercise and maybe even some graphs. He solved that by writing a bit of Elisp, <a href=\"https:\/\/blog.polaris64.net\/post\/emacs-using-org-mode-to-track-exercises\/\">which you can see in his blog post about his setup<\/a>. It would certainly have been easier to record the data in an Org table to begin with, which is what I do for things like this but I <i>do<\/i> like the idea of keeping everything in the journal and extracting the data you need for whatever project you\u2019re working on. It take a little more work but everything is in one place and easy to find.<\/p>\n<p>In any event, the reason I\u2019m writing about this is that Pugnet\u2019s code is a nice illustration of how to parse Org files and extract data from the entries. You can, of course, do that with regular expression search and other <i>ad hoc<\/i> methods but Org provides you with functions that take care of all that for you. It\u2019s worth studying Pugnet\u2019s post just to get an idea of how to do these things.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Like many people, Simon Pugnet likes to keep a record of his exercising. His regime includes several types of exercise such as running, sit-ups, and pushups. Also like many of us, he maintains a daily journal so, of course, it &hellip; <a href=\"https:\/\/irreal.org\/blog\/?p=11024\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5],"tags":[18,4],"class_list":["post-11024","post","type-post","status-publish","format-standard","hentry","category-general","tag-emacs","tag-org-mode"],"_links":{"self":[{"href":"https:\/\/irreal.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/11024","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/irreal.org\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/irreal.org\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/irreal.org\/blog\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/irreal.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=11024"}],"version-history":[{"count":1,"href":"https:\/\/irreal.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/11024\/revisions"}],"predecessor-version":[{"id":11025,"href":"https:\/\/irreal.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/11024\/revisions\/11025"}],"wp:attachment":[{"href":"https:\/\/irreal.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=11024"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/irreal.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=11024"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/irreal.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=11024"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}