{"id":1965,"date":"2022-12-09T01:22:22","date_gmt":"2022-12-09T00:22:22","guid":{"rendered":"http:\/\/www.meanboyfriend.com\/overdue_ideas\/?p=1965"},"modified":"2022-12-09T01:28:34","modified_gmt":"2022-12-09T00:28:34","slug":"advent-of-code-with-openrefine-day-3","status":"publish","type":"post","link":"http:\/\/www.meanboyfriend.com\/overdue_ideas\/2022\/12\/advent-of-code-with-openrefine-day-3\/","title":{"rendered":"Advent of Code with OpenRefine Day 3"},"content":{"rendered":"\n<p>The way I solved this puzzle has a nice use of <code>value.<a href=\"https:\/\/openrefine.org\/docs\/manual\/grelfunctions#splits-s-or-p-sep-b-preservetokens-optional\">split<\/a>(\/\/)<\/code> to get an array of letters from a string, as well as:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><a href=\"https:\/\/openrefine.org\/docs\/manual\/grelfunctions#splitbylengthss-n1-n2\">splitByLengths<\/a>()<\/li>\n\n\n\n<li><a href=\"https:\/\/openrefine.org\/docs\/manual\/grelfunctions#lengths\">length<\/a>()<\/li>\n\n\n\n<li><a href=\"https:\/\/openrefine.org\/docs\/manual\/grel#filtere1-v-e-test\">filter<\/a>()<\/li>\n\n\n\n<li><a href=\"https:\/\/openrefine.org\/docs\/manual\/grelfunctions#unicodes\">unicode<\/a>()<\/li>\n\n\n\n<li><a href=\"https:\/\/openrefine.org\/docs\/manual\/grel#withe1-variable-v-e2\">with<\/a>()<\/li>\n\n\n\n<li><a href=\"https:\/\/openrefine.org\/docs\/manual\/grelfunctions#andb1-b2-\">and<\/a>()<\/li>\n<\/ul>\n\n\n\n<p>That&#8217;s quite a list of functions for something I thought was relatively straightforward!<\/p>\n\n\n\n<p>There&#8217;s also a more appropriate use of the OpenRefine Record mode in the second part (although I still revert to the <a href=\"http:\/\/www.meanboyfriend.com\/overdue_ideas\/2022\/12\/advent-of-code-with-openrefine-day-2\/\">horrible hack used in day 2<\/a> to add together all the numbers in a column). Creating the records in the second part includes a neat hack to group together a set number of rows which works easily because of a quirk of the way OpenRefine handles numbers which I completely fail to explain properly in the screen capture!<\/p>\n\n\n\n<figure class=\"wp-block-embed is-type-video is-provider-youtube wp-block-embed-youtube wp-embed-aspect-4-3 wp-has-aspect-ratio\"><div class=\"wp-block-embed__wrapper\">\n<iframe loading=\"lazy\" title=\"Advent of Code 2022 Day 3 using OpenRefine\" width=\"640\" height=\"480\" src=\"https:\/\/www.youtube.com\/embed\/YashjG3CzG8?feature=oembed\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\" referrerpolicy=\"strict-origin-when-cross-origin\" allowfullscreen><\/iframe>\n<\/div><\/figure>\n","protected":false},"excerpt":{"rendered":"<p>The way I solved this puzzle has a nice use of value.split(\/\/) to get an array of letters from a string, as well as: That&#8217;s quite a list of functions for something I thought was relatively straightforward! There&#8217;s also a more appropriate use of the OpenRefine Record mode in the second part (although I still [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[104],"class_list":["post-1965","post","type-post","status-publish","format-standard","hentry","category-uncategorized","tag-adventofcode2022"],"_links":{"self":[{"href":"http:\/\/www.meanboyfriend.com\/overdue_ideas\/wp-json\/wp\/v2\/posts\/1965","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.meanboyfriend.com\/overdue_ideas\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.meanboyfriend.com\/overdue_ideas\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.meanboyfriend.com\/overdue_ideas\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"http:\/\/www.meanboyfriend.com\/overdue_ideas\/wp-json\/wp\/v2\/comments?post=1965"}],"version-history":[{"count":3,"href":"http:\/\/www.meanboyfriend.com\/overdue_ideas\/wp-json\/wp\/v2\/posts\/1965\/revisions"}],"predecessor-version":[{"id":1968,"href":"http:\/\/www.meanboyfriend.com\/overdue_ideas\/wp-json\/wp\/v2\/posts\/1965\/revisions\/1968"}],"wp:attachment":[{"href":"http:\/\/www.meanboyfriend.com\/overdue_ideas\/wp-json\/wp\/v2\/media?parent=1965"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.meanboyfriend.com\/overdue_ideas\/wp-json\/wp\/v2\/categories?post=1965"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.meanboyfriend.com\/overdue_ideas\/wp-json\/wp\/v2\/tags?post=1965"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}