{"id":3066,"date":"2022-12-08T13:20:13","date_gmt":"2022-12-08T21:20:13","guid":{"rendered":"https:\/\/www.wellgolly.com\/?p=3066"},"modified":"2022-12-08T13:20:13","modified_gmt":"2022-12-08T21:20:13","slug":"sorting-columnar-data-in-bbedit","status":"publish","type":"post","link":"https:\/\/www.wellgolly.com\/?p=3066","title":{"rendered":"Sorting columnar data in BBEdit"},"content":{"rendered":"<p>I had a list of books in a MariaDB table that I wanted to redo by date. There may be a way to export selected fields and sorted data from MariDB using PHPMyAdmin, but I don\u2019t know the trick. <\/p>\n<p>But it is possible, in some cases, to sort data by columns in BBEdit if the data cooperates. In this case it did.<\/p>\n<p><pre><code class=\"preserve-code-formatting\">\n(1, &#039;Fer-de-Lance&#039;, NULL, 1934, &#039;553385453&#039;, \n(2, &#039;The League of Frightened Men&#039;, NULL, 1935, &#039;553385453&#039;, \n(3, &#039;The Rubber Band&#039;, NULL, 1936, &#039;553763091&#039;, \n(9, &#039;The Silent Speaker&#039;, NULL, 1946, &#039;553234978&#039;, \n(10, &#039;Too Many Women&#039;, NULL, 1947, &#039;553250663&#039;, \n...\n(34, &#039;Black Orchids&#039;, NULL, 1942, &#039;0553257196&#039;,\n(35, &#039;Not Quite Dead Enough&#039;, NULL, 1944, &#039;0553261096&#039;, \n<\/code><\/pre><br \/>\nAll I need to do was figure out a grep pattern that would match just the date field.<br \/>\nThe first thing I did was search for the field I wanted to sort by. It took some experimenting but the code used to find the field I was looking for is:<br \/>\n<pre><code class=\"preserve-code-formatting\">\nNULL, \\d{4}\n<\/code><\/pre><br \/>\nwhere \\d means look for digits and {4} tells how many.<\/p>\n<p><img src='\/images\/Sort_search.png' alt='Sort search example' \/><br \/>\nPutting that code into the \u201cSort using pattern\u201d sort field results in lines sorted by date. Alternatively,<br \/>\n<pre><code class=\"preserve-code-formatting\">\n\\d{4},\n<\/code><\/pre><br \/>\nalso works.<\/p>\n<p>Then its a simple matter of stripping off the ID field and renumbering.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I had a list of books in a MariaDB table that I wanted to redo by date. There may be a way to export selected fields and sorted data from MariDB using PHPMyAdmin, but I don\u2019t know the trick. But it is possible, in some cases, to sort data by columns in BBEdit if the &hellip; <a href=\"https:\/\/www.wellgolly.com\/?p=3066\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">Sorting columnar data in BBEdit<\/span><\/a><\/p>\n","protected":false},"author":6,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8],"tags":[],"class_list":["post-3066","post","type-post","status-publish","format-standard","hentry","category-coding"],"_links":{"self":[{"href":"https:\/\/www.wellgolly.com\/index.php?rest_route=\/wp\/v2\/posts\/3066","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wellgolly.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wellgolly.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wellgolly.com\/index.php?rest_route=\/wp\/v2\/users\/6"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wellgolly.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=3066"}],"version-history":[{"count":3,"href":"https:\/\/www.wellgolly.com\/index.php?rest_route=\/wp\/v2\/posts\/3066\/revisions"}],"predecessor-version":[{"id":3069,"href":"https:\/\/www.wellgolly.com\/index.php?rest_route=\/wp\/v2\/posts\/3066\/revisions\/3069"}],"wp:attachment":[{"href":"https:\/\/www.wellgolly.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=3066"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wellgolly.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=3066"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wellgolly.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=3066"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}